Fix events watching XenServer < 6.0.
This commit is contained in:
parent
fcbc476462
commit
277669a13c
@ -575,19 +575,26 @@ export class Xapi extends EventEmitter {
|
|||||||
|
|
||||||
return Promise.all(map(
|
return Promise.all(map(
|
||||||
getAllRecordsMethods,
|
getAllRecordsMethods,
|
||||||
method => this._sessionCall(method, []).then(objects => {
|
method => this._sessionCall(method, []).then(
|
||||||
const type = method.slice(0, method.indexOf('.')).toLowerCase()
|
objects => {
|
||||||
forEach(objects, (object, ref) => {
|
const type = method.slice(0, method.indexOf('.')).toLowerCase()
|
||||||
this._addObject(type, ref, object)
|
forEach(objects, (object, ref) => {
|
||||||
})
|
this._addObject(type, ref, object)
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
if (error.code !== 'MESSAGE_REMOVED') {
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const watchEvents = (() => {
|
const watchEvents = (() => {
|
||||||
const loop = ((onSuccess, onFailure) => {
|
const loop = ((onSuccess, onFailure) => {
|
||||||
return this._sessionCall('event.next', []).then(onSuccess, onFailure)
|
return () => this._sessionCall('event.next', []).then(onSuccess, onFailure)
|
||||||
})(
|
})(
|
||||||
events => {
|
events => {
|
||||||
this._processEvents(events)
|
this._processEvents(events)
|
||||||
|
Loading…
Reference in New Issue
Block a user