chore(xo-server/snapshotVm): avoid using waitObjectState

This commit is contained in:
Julien Fontanet
2018-03-30 12:36:39 +02:00
parent 505f06c1d8
commit a83fa90d87

View File

@@ -1442,8 +1442,6 @@ export default class Xapi extends XapiBase {
nameLabel
).then(extractOpaqueRef)
this.addTag(ref, 'quiesce')::ignoreErrors()
await this._waitObjectState(ref, vm => includes(vm.tags, 'quiesce'))
} catch (error) {
const { code } = error
if (
@@ -1467,7 +1465,7 @@ export default class Xapi extends XapiBase {
// to-date object.
const [, snapshot] = await Promise.all([
this.call('VM.set_is_a_template', ref, false),
this._waitObjectState(ref, snapshot => !snapshot.is_a_template),
this.barrier(ref),
])
return snapshot