fix(xo-server): handle unfetched VDIs in pool.$ha_statefiles (#6404)

Introduced by 4dc7575d5

Fixes zammad#9498
This commit is contained in:
Mathieu 2022-09-06 11:37:13 +02:00 committed by GitHub
parent 243bffebbd
commit 2371109b6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -12,6 +12,7 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”
- [Plugin/auth-saml] Certificate input support multiline (PR [#6403](https://github.com/vatesfr/xen-orchestra/pull/6403))
- [Storage/Pool] Fix `an error as occured` (PR [#6404](https://github.com/vatesfr/xen-orchestra/pull/6404))
### Packages to release

View File

@ -107,7 +107,10 @@ const TRANSFORMS = {
current_operations: obj.current_operations,
default_SR: link(obj, 'default_SR'),
HA_enabled: Boolean(obj.ha_enabled),
haSrs: obj.$ha_statefiles.map(vdi => link(vdi, 'SR')),
// ignore undefined VDIs, which occurs if the objects were not fetched/cached yet.
haSrs: obj.$ha_statefiles.filter(vdi => vdi !== undefined).map(vdi => link(vdi, 'SR')),
master: link(obj, 'master'),
tags: obj.tags,
name_description: obj.name_description,