From 04023a0ebbb1877898696642a3f2b827651cdcc2 Mon Sep 17 00:00:00 2001 From: Sergio Betanzos Date: Tue, 10 Mar 2020 19:24:59 +0100 Subject: [PATCH] B #4274: Fix VM templates in Sunstone (#4333) B #4278: Fix VM templates in Sunstone --- .../tabs/templates-tab/form-panels/create-common.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create-common.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create-common.js index 0848b9a85b..befb3d4dcf 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create-common.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create-common.js @@ -219,6 +219,7 @@ define(function(require) { delete templateJSON["NIC_PCI"]; } + return templateJSON; } @@ -256,11 +257,10 @@ define(function(require) { current = currentTemplate[0].VMTEMPLATE.TEMPLATE; } if(current) { - if (current.NIC && !templateJSON.NIC) { - delete current.NIC; - } - if(current.NIC_ALIAS && !templateJSON.NIC_ALIAS) { - delete current.NIC_ALIAS; + for (key in current) { + if (!templateJSON[key]) { + delete current[key] + } } } }