fix(xo-server): invalid arguments passed to VM_destroy (#6119)

Fixes #6124
See https://xcp-ng.org/forum/topic/5569

Introduced by cb52a8b51
This commit is contained in:
Pierre Donias 2022-03-17 14:37:45 +01:00 committed by GitHub
parent 886ff2cd70
commit 3f07f7ef41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -16,6 +16,7 @@
- [Rolling Pool Update] Don't fail if `load-balancer` plugin is missing (Starter and Enterprise plans) - [Rolling Pool Update] Don't fail if `load-balancer` plugin is missing (Starter and Enterprise plans)
- [Backup/Restore] Fix missing backups on Backblaze - [Backup/Restore] Fix missing backups on Backblaze
- [Templates] Fix "incorrect state" error when trying to delete a default template [#6124](https://github.com/vatesfr/xen-orchestra/issues/6124) (PR [#6119](https://github.com/vatesfr/xen-orchestra/pull/6119))
### Packages to release ### Packages to release

View File

@ -149,7 +149,7 @@ export const create = defer(async function ($defer, params) {
} }
const xapiVm = await xapi.createVm(template._xapiId, params, checkLimits) const xapiVm = await xapi.createVm(template._xapiId, params, checkLimits)
$defer.onFailure(() => xapi.VM_destroy(xapiVm.$ref, true, true)) $defer.onFailure(() => xapi.VM_destroy(xapiVm.$ref, { deleteDisks: true, force: true }))
const vm = xapi.xo.addObject(xapiVm) const vm = xapi.xo.addObject(xapiVm)
@ -382,7 +382,7 @@ const delete_ = defer(async function (
} }
}) })
return xapi.VM_destroy(vm._xapiRef, deleteDisks, force, forceDeleteDefaultTemplate) return xapi.VM_destroy(vm._xapiRef, { deleteDisks, force, forceDeleteDefaultTemplate })
}) })
delete_.params = { delete_.params = {