Skip to content

Commit

Permalink
Merge "Changes for issues with service instances"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Feb 5, 2016
2 parents 4b56efa + b3f2e8f commit ebb1699
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
3 changes: 3 additions & 0 deletions webroot/config/networking/networks/ui/js/models/vnCfgModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,9 @@ define([
if (hostRoutes.length == 0) {
delete subnet['host_routes'];
}
if(dnsServers.length == 0) {
delete subnet['dhcp_option_list'];
}

delete subnet['errors'];
delete subnet['locks'];
Expand Down
19 changes: 18 additions & 1 deletion webroot/config/services/instances/ui/js/models/svcInstModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ define([
max_instances: 1
},
},
service_template: null,
service_template_refs: [],
fq_name: [],
uuid: null,
Expand Down Expand Up @@ -820,9 +819,16 @@ define([
getSIProperties: function() {
var siProp = {};
var intfList = [];
var stVersion;
var sTemplate = getValueByJsonPath(this.model().attributes,
"service_template", "");
stVersion = sTemplate.split('] - ')[1];
var coll = this.model().attributes.interfaces;
var len = coll.length;
var models = coll['models'];
if(stVersion.toString().toLowerCase() === "v2") {
return siProp;
}
for (var i = 0; i < len; i++) {
var attr = models[i]['attributes'];
intfList[i] = {};
Expand Down Expand Up @@ -867,21 +873,32 @@ define([
if ((null != list) && (list.length > 0)) {
propObjs['interface_route_table_back_refs'] =
list;
} else {
propObjs['interface_route_table_back_refs'] = [];
}

list =
this.getSvcInstPropertiesByType('service_health_check_back_refs');
if ((null != list) && (list.length > 0)) {
propObjs['service_health_check_back_refs'] = list;
} else {
propObjs['service_health_check_back_refs'] = [];
}

list =
this.getSvcInstPropertiesByType('route_aggregate_back_refs');
if ((null != list) && (list.length > 0)) {
propObjs['route_aggregate_back_refs'] = list;
}else {
propObjs['route_aggregate_back_refs'] = [];
}

list =
this.getSvcInstPropertiesByType('routing_policy_back_refs');
if ((null != list) && (list.length > 0)) {
propObjs['routing_policy_back_refs'] = list;
} else {
propObjs['routing_policy_back_refs'] = [];
}
return propObjs;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ define([
}
},
{
key: 'service_instance_properties',
key: 'service_instance_properties.interface_list',
keyClass: 'span2',
label: 'Networks',
templateGenerator: 'TextGenerator',
Expand Down

0 comments on commit ebb1699

Please sign in to comment.