fix(xo-server/mergeXenPools): pool id → server id (#3728)

See #2238
This commit is contained in:
badrAZ 2018-11-28 15:56:30 +01:00 committed by Julien Fontanet
parent e65b3200cd
commit f06a937c9c
2 changed files with 9 additions and 4 deletions

View File

@ -10,6 +10,8 @@
### Bug fixes
- [Servers] Fix deleting server on joining a pool [#2238](https://github.com/vatesfr/xen-orchestra/issues/2238) (PR [#3728](https://github.com/vatesfr/xen-orchestra/pull/3728))
### Released packages
- xen-api v0.22.0

View File

@ -1,4 +1,5 @@
import createLogger from '@xen-orchestra/log'
import { findKey } from 'lodash'
import { ignoreErrors } from 'promise-toolbox'
import { noSuchObject } from 'xo-common/api-errors'
@ -440,12 +441,12 @@ export default class {
return this._stats.getSrStats(this.getXapi(srId), srId, granularity)
}
async mergeXenPools(sourceId, targetId, force = false) {
const sourceXapi = this.getXapi(sourceId)
async mergeXenPools(sourcePoolId, targetPoolId, force = false) {
const sourceXapi = this.getXapi(sourcePoolId)
const {
_auth: { user, password },
_url: { hostname },
} = this.getXapi(targetId)
} = this.getXapi(targetPoolId)
// We don't want the events of the source XAPI to interfere with
// the events of the new XAPI.
@ -459,6 +460,8 @@ export default class {
throw e
}
await this.unregisterXenServer(sourceId)
this.unregisterXenServer(
findKey(this._xapis, candidate => candidate === sourceXapi)
)::ignoreErrors()
}
}