fix(xo-server/installPatches): fix pool wide detection (#6231)

Introduced by 3f1c41a4f

Fixes zammad#6819 zammad#6781 zammad#6827

In #6186 the behavior was changed to always pass hosts, which broke the pool wide detection.
This commit is contained in:
Julien Fontanet
2022-05-12 10:56:18 +02:00
committed by GitHub
parent 29e8a7fd7e
commit e4f1b8f2e0
2 changed files with 5 additions and 1 deletions

View File

@@ -11,6 +11,8 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”
- [Pool/Patches] Fix failure to install patches on Citrix Hypervisor (PR [#6231](https://github.com/vatesfr/xen-orchestra/pull/6231))
### Packages to release
> Packages will be released in the order they are here, therefore, they should

View File

@@ -116,6 +116,7 @@ listMissingPatches.resolve = {
// -------------------------------------------------------------------
export async function installPatches({ pool, patches, hosts }) {
const opts = { patches }
let xapi
if (pool !== undefined) {
pool = this.getXapiObject(pool, 'pool')
@@ -123,6 +124,7 @@ export async function installPatches({ pool, patches, hosts }) {
hosts = Object.values(xapi.objects.indexes.type.host)
} else {
hosts = hosts.map(_ => this.getXapiObject(_))
opts.hosts = hosts
xapi = hosts[0].$xapi
pool = xapi.pool
}
@@ -136,7 +138,7 @@ export async function installPatches({ pool, patches, hosts }) {
})
}
await xapi.installPatches({ hosts, patches })
await xapi.installPatches(opts)
const masterRef = pool.master
if (moveFirst(hosts, _ => _.$ref === masterRef)) {