From d597cefe154fd8a86e35ac8f14da24a0768f17eb Mon Sep 17 00:00:00 2001 From: Abel Coronado Date: Thu, 7 Sep 2017 12:46:27 +0200 Subject: [PATCH] B #5354: Solved bug wrong size to disk (VM temp update) (#461) --- .../create/wizard-tabs/storage/disk-tab.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/storage/disk-tab.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/storage/disk-tab.js index 714fde8f73..37fe4678b2 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/storage/disk-tab.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/storage/disk-tab.js @@ -151,7 +151,6 @@ define(function(require) { selectedContext = $("div.image", context); } else { selectedContext = $("div.volatile", context); - var typeKvm = $("#TYPE_KVM", context).val(); var typeVcenter = $("#TYPE_VCENTER", context).val(); var type = "fs"; @@ -168,9 +167,14 @@ define(function(require) { } var tmpl = WizardFields.retrieve(selectedContext); + if(type){ + tmpl.TYPE = type; + } - tmpl.TYPE = type; - + if(tmpl.SIZE != undefined && $(".mb_input_unit", context).val() == "GB"){ + tmpl.SIZE = tmpl.SIZE * 1024; + tmpl.SIZE = tmpl.SIZE.toString(); + } var formatKvm = $("#FORMAT_KVM", context).val(); var formatVcenter = $("#FORMAT_VCENTER", context).val(); @@ -180,11 +184,6 @@ define(function(require) { tmpl.FORMAT = formatVcenter; } - if($(".mb_input_unit", context).val() == "GB"){ - tmpl.SIZE = tmpl.SIZE * 1024; - tmpl.SIZE = tmpl.SIZE.toString(); - } - if($("input[name='" + this.diskTabId + "']:checked", context).val() == "image" && !tmpl["IMAGE"] && !tmpl["IMAGE_ID"]){ return {}; }