fix(xo-server/xapi): don't silently swallow errors on _callInstallationPlugin (#5809)

See xoa-support#3738

Introduced by a73acedc4d

This was done to prevent triggering an error when the pack was already
installed but a XENAPI_PLUGIN_FAILURE error can happen for other reasons
This commit is contained in:
Pierre Donias
2021-06-14 16:01:02 +02:00
committed by GitHub
parent 5ddceb4660
commit 05fe154749

View File

@@ -962,10 +962,10 @@ export default class Xapi extends XapiBase {
@synchronized()
_callInstallationPlugin(hostRef, vdi) {
return this.call('host.call_plugin', hostRef, 'install-supp-pack', 'install', { vdi }).catch(error => {
if (error.code !== 'XENAPI_PLUGIN_FAILURE') {
log.warn('_callInstallationPlugin', { error })
if (error.code !== 'XENAPI_PLUGIN_FAILURE' || !error.params?.[2]?.includes?.('UPDATE_ALREADY_APPLIED')) {
throw error
}
log.warn('_callInstallationPlugin', { error })
})
}