fix(xapi/VM_destroy): only update default template when forceDeleteDefaultTemplate

This commit is contained in:
Julien Fontanet 2021-03-24 15:07:30 +01:00
parent d191ca54ad
commit c7677d6d1e

View File

@ -293,10 +293,10 @@ module.exports = class Vm {
} }
await Promise.all([ await Promise.all([
vm.set_is_default_template(false), forceDeleteDefaultTemplate && vm.set_is_default_template(false),
forceDeleteDefaultTemplate && vm.update_other_config('default_template', null),
vm.set_is_a_template(false), vm.set_is_a_template(false),
vm.update_blocked_operations('destroy', null), vm.update_blocked_operations('destroy', null),
vm.update_other_config('default_template', null),
]) ])
// must be done before destroying the VM // must be done before destroying the VM