M #~: OS template double quotes (#1039)

This commit is contained in:
Frederick Borges authored and GitHub committed 2021-03-29 12:33:19 +02:00
1 parent 5ef233fd9c
commit 8187073303
1 file changed
+6 -1
@@ -464,6 +464,10 @@ define(function(require) {
var boot = _retrieveBootValue(context);
var os = original_tmpl.TEMPLATE.OS ? original_tmpl.TEMPLATE.OS : {};
for ([key, value] of Object.entries(os)) {
os[key] = value.replaceAll('"', '\\"');
}
if (boot && boot.length > 0) {
os.BOOT = boot;
@@ -472,10 +476,11 @@ define(function(require) {
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
Sunstone.runAction("Template."+action, [template_id], extra_info);
}
});