Update xen-api to 0.5.6.
This commit is contained in:
parent
5c414fc7b4
commit
6d87a1a604
@ -80,7 +80,7 @@
|
||||
"then-redis": "~1.3.0",
|
||||
"trace": "^1.2.0",
|
||||
"ws": "~0.7.1",
|
||||
"xen-api": "^0.5.4",
|
||||
"xen-api": "^0.5.6",
|
||||
"xml2js": "~0.4.6",
|
||||
"xo-collection": "^0.3.2"
|
||||
},
|
||||
|
14
src/xapi.js
14
src/xapi.js
@ -7,7 +7,10 @@ import map from 'lodash.map'
|
||||
import unzip from 'julien-f-unzip'
|
||||
import {PassThrough} from 'stream'
|
||||
import {promisify} from 'bluebird'
|
||||
import {Xapi as XapiBase} from 'xen-api'
|
||||
import {
|
||||
wrapError as wrapXapiError,
|
||||
Xapi as XapiBase
|
||||
} from 'xen-api'
|
||||
|
||||
import {debounce} from './decorators'
|
||||
import {ensureArray, noop, parseXml, pFinally} from './utils'
|
||||
@ -19,13 +22,6 @@ const debug = createDebug('xo:xapi')
|
||||
|
||||
const gotPromise = promisify(got)
|
||||
|
||||
const wrapError = error => {
|
||||
const e = new Error(error[0])
|
||||
e.code = error[0]
|
||||
e.params = error.slice(1)
|
||||
return e
|
||||
}
|
||||
|
||||
// ===================================================================
|
||||
|
||||
const typeToNamespace = Object.create(null)
|
||||
@ -107,7 +103,7 @@ export default class Xapi extends XapiBase {
|
||||
if (status === 'success') {
|
||||
taskWatchers[ref].resolve(object.result)
|
||||
} else if (status === 'failure') {
|
||||
taskWatchers[ref].reject(wrapError(object.error_info))
|
||||
taskWatchers[ref].reject(wrapXapiError(object.error_info))
|
||||
} else {
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user