From 60fe076f85d427325e44b0d9762030974986f8cf Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Tue, 13 Dec 2011 14:34:58 +0100 Subject: [PATCH] Sunstone's multiple VM instantation should act as CLI's when naming the new VMs (cherry picked from commit be1cea51b1d8d376ee3d34a9ac88ea0b578193af) --- src/sunstone/public/js/plugins/vms-tab.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/sunstone/public/js/plugins/vms-tab.js b/src/sunstone/public/js/plugins/vms-tab.js index bdf52bc315..fcb660d857 100644 --- a/src/sunstone/public/js/plugins/vms-tab.js +++ b/src/sunstone/public/js/plugins/vms-tab.js @@ -750,20 +750,17 @@ function setupCreateVMDialog(){ if (!template_id.length){ notifyError("You have not selected a template"); return false; - } + }; if (n_times.length){ n_times_int=parseInt(n_times,10); - } + }; - if (n_times_int>1){ - if (!vm_name.length){ - vm_name = $('#template_id option:selected',this).text(); - } - for (var i=0; i< n_times_int; i++){ - Sunstone.runAction("Template.instantiate",template_id,vm_name+"_"+i); - }; - } else { + if (!vm_name.length){ + vm_name = $('#template_id option:selected',this).text(); + }; + + for (var i=0; i< n_times_int; i++){ Sunstone.runAction("Template.instantiate",template_id,vm_name); };