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

(cherry picked from commit cf9b5bffad)
This commit is contained in:
Pavel Czerný authored and Ruben S. Montero committed 2021-06-07 11:20:21 +02:00
1 parent 695946153f
commit 2a413d3095
1 file changed
+6 -2
+6 -2
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);
}