Minor fixes.

This commit is contained in:
Julien Fontanet 2015-04-13 16:50:00 +02:00
parent d32a18d965
commit 8e7830dd7d
4 changed files with 10 additions and 4 deletions

View File

@ -76,7 +76,7 @@
"source-map-support": "^0.2.10",
"then-redis": "~1.3.0",
"ws": "~0.7.1",
"xen-api": "^0.1.1",
"xen-api": "^0.2.1",
"xml2js": "~0.4.6",
"xmlrpc": "~1.3.0"
},

View File

@ -180,7 +180,13 @@ let apiHelpers = {
// Handles both properties and wrapped models.
let properties = server.properties || server;
return pick(properties, 'id', 'host', 'username');
server = pick(properties, 'id', 'host', 'username');
// Injects connection status.
const xapi = this._xapis[server.id]
server.status = xapi ? xapi.status : 'disconnected'
return server
},
throw(errorId, data) {

View File

@ -202,7 +202,7 @@ module.exports = ->
@val.UUID = -> @genval.uuid
@val.ref = -> @genval.$ref
@val.poolRef = -> @genval.$pool.$ref
@val.$poolId = -> @genval.$pool.id
@val.$poolId = -> @genval.$pool.$id
# Main objects all can have associated messages and tags.
if @name in ['host', 'pool', 'SR', 'VM', 'VM-controller']

View File

@ -302,7 +302,7 @@ class $XO extends $EventEmitter
})
)
xapi.objects.on('update', (objects) =>
@_xapis[xapi.pool.id] = xapi
@_xapis[xapi.pool.$id] = xapi
@_xobjs.set(objects, {
add: true,