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

M #~: fix vm_template_content undefined (#88)

Signed-off-by: Jorge Lobo <jlobo@opennebula.io>
(cherry picked from commit c2ab2e12d272f17fe5e0aa86758b62de4939c5d3)
This commit is contained in:
Jorge Miguel Lobo Escalona 2020-07-14 17:34:08 +02:00 committed by Tino Vazquez
parent b6228d90c5
commit ab2000f5c2
No known key found for this signature in database
GPG Key ID: 2FE9C32E94AEABBE

View File

@ -237,8 +237,8 @@ define(function(require) {
var extra_info = ServiceUtils.getExtraInfo(context);
if(
that &&
that.service_template_json &&
that &&
that.service_template_json &&
that.service_template_json.DOCUMENT &&
that.service_template_json.DOCUMENT.TEMPLATE &&
that.service_template_json.DOCUMENT.TEMPLATE.BODY &&
@ -253,7 +253,7 @@ define(function(require) {
role.user_inputs_values = tmp_json;
if (stringCustomValues) {
(temp_role.vm_template_contents)
? temp_role.vm_template_contents += stringCustomValues
? temp_role.vm_template_contents += stringCustomValues
: temp_role.vm_template_contents = stringCustomValues;
}
$("#instantiate_service_role_user_inputs").find("select").each(function(key, vm_group){
@ -267,6 +267,13 @@ define(function(require) {
temp_role.vm_template_contents += TemplateUtils.templateToString({VMGROUP:{ROLE:role.name,VMGROUP_ID:vm_group_value}});
}
});
if(charters.length){
if(temp_role.vm_template_contents !== undefined){
temp_role.vm_template_contents += charters;
}else{
temp_role.vm_template_contents = charters;
}
}
extra_info.merge_template.roles.push(temp_role);
});
}