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:
@@ -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
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user