fix(xo-server/patching): always check that XS credentials are configured on XS (#7093)

Introduced by a30d962b1d
This commit is contained in:
Pierre Donias 2023-10-13 16:49:04 +02:00 committed by GitHub
parent 77d53d2abf
commit fb52868074
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -405,6 +405,11 @@ export default {
},
_poolWideInstall: deferrable(async function ($defer, patches, xsCredentials) {
// New XS patching system: https://support.citrix.com/article/CTX473972/upcoming-changes-in-xencenter
if (xsCredentials?.username === undefined || xsCredentials?.apikey === undefined) {
throw new Error('XenServer credentials not found. See https://xen-orchestra.com/docs/updater.html#xenserver-updates')
}
// Legacy XS patches
if (!useUpdateSystem(this.pool.$master)) {
// for each patch: pool_patch.pool_apply
@ -420,11 +425,6 @@ export default {
}
// ----------
// New XS patching system: https://support.citrix.com/article/CTX473972/upcoming-changes-in-xencenter
if (xsCredentials?.username === undefined || xsCredentials?.apikey === undefined) {
throw new Error('XenServer credentials not found. See https://xen-orchestra.com/docs/updater.html#xenserver-updates')
}
// for each patch: pool_update.introduce → pool_update.pool_apply
for (const p of patches) {
const [vdi] = await Promise.all([this._uploadPatch($defer, p.uuid, xsCredentials), this._ejectToolsIsos()])