fix(xo-server/clearHost): explicit message on missing migration network
Fixes zammad#14882
This commit is contained in:
@@ -13,7 +13,8 @@
|
||||
|
||||
> Users must be able to say: “I had this issue, happy to know it's fixed”
|
||||
|
||||
- [Incremental Replication] Fix task showing as *interrupted* when running without health check [Forum#62669](https://xcp-ng.org/forum/post/62669) (PR [#6866](https://github.com/vatesfr/xen-orchestra/pull/6866))
|
||||
- [Incremental Replication] Fix task showing as _interrupted_ when running without health check [Forum#62669](https://xcp-ng.org/forum/post/62669) (PR [#6866](https://github.com/vatesfr/xen-orchestra/pull/6866))
|
||||
- [Host evacuation] Better error message when migration network no longer exists
|
||||
|
||||
### Packages to release
|
||||
|
||||
|
||||
@@ -182,8 +182,15 @@ export default class Xapi extends XapiBase {
|
||||
async clearHost({ $ref: hostRef, $pool: pool }, force) {
|
||||
await this.call('host.disable', hostRef)
|
||||
|
||||
const migrationNetworkId = pool.other_config['xo:migrationNetwork']
|
||||
const migrationNetworkRef = migrationNetworkId && this.getObject(migrationNetworkId).$ref
|
||||
const migrationNetworkRef = (id => {
|
||||
if (id !== undefined) {
|
||||
const network = this.getObject(id, undefined)
|
||||
if (network === undefined) {
|
||||
throw new Error('could not find migration network ' + id)
|
||||
}
|
||||
return network.$ref
|
||||
}
|
||||
})(pool.other_config['xo:migrationNetwork'])
|
||||
try {
|
||||
try {
|
||||
await (migrationNetworkRef === undefined
|
||||
|
||||
Reference in New Issue
Block a user