fix(xo-server/vm.importFromEsxi): userdevice is a string (#7361)

Introduced by 59cc418973

From zammad#82017 and other tickets
This commit is contained in:
Florent BEAUCHAMP 2024-02-07 10:24:50 +01:00 committed by GitHub
parent 2498a4f47c
commit 2b3ccb4b0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -11,6 +11,8 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”
- [Import/VMWare] Fix `(Failure \"Expected string, got 'I(0)'\")` (PR [#7361](https://github.com/vatesfr/xen-orchestra/issues/7361))
### Packages to release
> When modifying a package, add it here with its release type.
@ -27,4 +29,6 @@
<!--packages-start-->
- xo-server patch
<!--packages-end-->

View File

@ -265,7 +265,7 @@ export default class MigrateVm {
VDI: vdi.$ref,
VM: vm.$ref,
device: `xvd${String.fromCharCode('a'.charCodeAt(0) + userdevice)}`,
userdevice: userdevice < 3 ? userdevice : userdevice + 1,
userdevice: String(userdevice < 3 ? userdevice : userdevice + 1),
})
} else {
vhd = await openDeltaVmdkasVhd(esxi, datastore, path + '/' + fileName, parentVhd, {
@ -316,7 +316,7 @@ export default class MigrateVm {
VDI: vdi.$ref,
VM: vm.$ref,
device: `xvd${String.fromCharCode('a'.charCodeAt(0) + userdevice)}`,
userdevice: userdevice < 3 ? userdevice : userdevice + 1,
userdevice: String(userdevice < 3 ? userdevice : userdevice + 1),
})
} else {
if (parentVhd === undefined) {