From e7baf0c3fa2af7756833d82e862fbb6e3947645f Mon Sep 17 00:00:00 2001 From: Frederick Borges Date: Mon, 12 Apr 2021 14:12:15 +0200 Subject: [PATCH] B #5327: Fix attribute deletion when update secgroup (#1089) Signed-off-by: Frederick Borges --- .../public/app/tabs/secgroups-tab/form-panels/create.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sunstone/public/app/tabs/secgroups-tab/form-panels/create.js b/src/sunstone/public/app/tabs/secgroups-tab/form-panels/create.js index 1272dbeddc..5afd912ba7 100644 --- a/src/sunstone/public/app/tabs/secgroups-tab/form-panels/create.js +++ b/src/sunstone/public/app/tabs/secgroups-tab/form-panels/create.js @@ -267,7 +267,6 @@ define(function(require) { } function _submitWizard(context) { - var name = WizardFields.retrieveInput($('#security_group_name', context)); var description = WizardFields.retrieveInput($('#security_group_description', context)); @@ -291,12 +290,15 @@ define(function(require) { Sunstone.runAction("SecurityGroup.create",security_group_json); return false; } else if (this.action == "update") { - delete security_group_json["NAME"]; + + var update_json = $.extend({},this.element.TEMPLATE,security_group_json) + + delete update_json["NAME"]; Sunstone.runAction( "SecurityGroup.update", this.resourceId, - TemplateUtils.templateToString(security_group_json)); + TemplateUtils.templateToString(update_json)); return false; } @@ -320,6 +322,7 @@ define(function(require) { } function _fill(context, element) { + this.element = element; var that = this; this.setHeader(element);