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

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

This commit is contained in:
Pavel Czerný 2021-06-07 11:19:30 +02:00 committed by GitHub
parent 86f0ab2c8f
commit cf9b5bffad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2932,7 +2932,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"));
@ -2950,7 +2954,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);
}