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

Development: Fix update conf for empty context attributes

This commit is contained in:
Ruben S. Montero 2016-05-05 11:50:12 +02:00
parent 511b966ba4
commit 3abf2a73c8

View File

@ -4964,13 +4964,14 @@ int VirtualMachine::updateconf(VirtualMachineTemplate& tmpl, string &err)
// -------------------------------------------------------------------------
// Update CONTEXT: any value
// -------------------------------------------------------------------------
VectorAttribute * context = obj_template->get("CONTEXT");
VectorAttribute * context_bck = context->clone();
replace_vector_values(obj_template, &tmpl, "CONTEXT", 0, -1);
VectorAttribute * context = obj_template->get("CONTEXT");
if ( context != 0 )
{
VectorAttribute * context_bck = context->clone();
replace_vector_values(obj_template, &tmpl, "CONTEXT", 0, -1);
generate_network_context(context, true);
if ( generate_token_context(context, err) != 0 ||
@ -4981,9 +4982,10 @@ int VirtualMachine::updateconf(VirtualMachineTemplate& tmpl, string &err)
return -1;
}
}
delete context_bck;
delete context_bck;
}
return 0;
}