1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B #5826: Fix instantiate when VM.instantiate_name set to false (#2059)

This commit is contained in:
Frederick Borges 2022-05-19 13:02:57 +02:00 committed by GitHub
parent a3307765e9
commit b7925c9440
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -217,7 +217,9 @@ define(function(require) {
return false;
}
var vm_name = $("#vm_name", context).val();
if (Config.isTabActionEnabled("vms-tab", "VM.instantiate_name")){
var vm_name = $("#vm_name", context).val();
}
var n_times = $("#vm_n_times", context).val();
var n_times_int = 1;
@ -407,16 +409,15 @@ define(function(require) {
if (boot && boot.length > 0) {
os.BOOT = boot;
tmp_json.OS = os;
} else {
tmp_json.OS = os;
}
tmp_json.OS = os;
extra_info["template"] = tmp_json;
for (var i = 0; i < n_times_int; i++) {
extra_info["vm_name"] = vm_name.replace(/%i/gi, i); // replace wildcard
if (Config.isTabActionEnabled("vms-tab", "VM.instantiate_name")){
extra_info["vm_name"] = vm_name.replace(/%i/gi, i); // replace wildcard
}
Sunstone.runAction("Template."+action, [template_id], extra_info);
}
});