Skip to content

Commit

Permalink
fix(xo-server/installPatches): fix pool wide detection
Browse files Browse the repository at this point in the history
Introduced by 3f1c41a

Fixes zammad#6819 zammad#6781 zammad#6827

In #6186 the behavior was changed to always pass hosts, which broke the pool wide detection.
  • Loading branch information
julien-f committed May 12, 2022
1 parent 29e8a7f commit 55d29f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/xo-server/src/api/pool.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,15 @@ listMissingPatches.resolve = {
// -------------------------------------------------------------------

export async function installPatches({ pool, patches, hosts }) {
const opts = { patches }
let xapi
if (pool !== undefined) {
pool = this.getXapiObject(pool, 'pool')
xapi = pool.$xapi
hosts = Object.values(xapi.objects.indexes.type.host)
} else {
hosts = hosts.map(_ => this.getXapiObject(_))
opts.hosts = hosts
xapi = hosts[0].$xapi
pool = xapi.pool
}
Expand All @@ -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)) {
Expand Down

0 comments on commit 55d29f3

Please sign in to comment.