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

B #5317: Fix updateconf for FILES_DS (#1275)

(cherry picked from commit cf9b5bffad14a7abaf6b11cddd61a55953c58f86)
This commit is contained in:
Pavel Czerný 2021-06-07 11:19:30 +02:00 committed by Ruben S. Montero
parent 695946153f
commit 2a413d3095
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -2930,7 +2930,11 @@ int VirtualMachine::updateconf(VirtualMachineTemplate* tmpl, string &err)
string files_ds_new = context_new->vector_value("FILES_DS");
context_new = context_new->clone();
context_new->remove("FILES_DS");
if (files_ds == files_ds_new)
{
context_new->remove("FILES_DS");
}
context_new->replace("TARGET", context_bck->vector_value("TARGET"));
context_new->replace("DISK_ID", context_bck->vector_value("DISK_ID"));
@ -2948,7 +2952,7 @@ int VirtualMachine::updateconf(VirtualMachineTemplate* tmpl, string &err)
context_new = obj_template->get("CONTEXT");
if ( !files_ds.empty() && !files_ds_new.empty())
if ((files_ds == files_ds_new) && !files_ds.empty())
{
context_new->replace("FILES_DS", files_ds);
}