B #4169: Fix clusters in VNet templates (#4182)

This commit is contained in:
Sergio Betanzos authored and GitHub committed 2020-02-12 18:36:20 +01:00
1 parent 6e21acba9f
commit 8024aa2c1c
2 files changed
+6 -7

No files matched your search

@@ -364,7 +364,7 @@ define(function(require) {
var clusters = this.clustersTable.retrieveResourceTableSelect();
if (clusters != undefined && clusters.length != 0) {
network_json["CLUSTERS"] = clusters.join(",");
network_json["CLUSTERS_IDS"] = clusters.join(",");
}
$.extend(network_json, CustomTagsTable.retrieve($("#vntemplateCreateContextTab", context)));
@@ -395,16 +395,15 @@ define(function(require) {
}
function _submitAdvanced(context) {
var template = $("textarea#template", context).val();
if (this.action == "create") {
var template = $("textarea#template", context).val();
var vntemplate_json = {vntemplate: {vntemplate_raw: template}};
var vntemplate_json = {vntemplate: { vntemplate_raw: template}};
Sunstone.runAction("VNTemplate.create", vntemplate_json);
return false;
} else if (this.action == "update") {
var template_raw = $("textarea#template", context).val();
var vntemplate_json = {vntemplate: {vntemplate_raw: template}};
Sunstone.runAction("VNTemplate.update", this.resourceId, vntemplate_json);
Sunstone.runAction("VNTemplate.update", this.resourceId, template);
return false;
}
}
@@ -58,7 +58,7 @@ define(function(require){
var clusters = [];
if (this.element.TEMPLATE.CLUSTERS != undefined){
clusters = this.element.TEMPLATE.CLUSTERS.split(",");
clusters = this.element.TEMPLATE.CLUSTERS_IDS.split(",");
if (!$.isArray(clusters)){
clusters = [clusters];