From f9dd00b79b6d40d14bad811f458fcb1205205c76 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Wed, 6 May 2015 15:36:20 +0200 Subject: [PATCH] Do not XO & XAPI objects. --- src/api/host.coffee | 2 +- src/xapi.js | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/api/host.coffee b/src/api/host.coffee index 72ae4a970..53b5067c3 100644 --- a/src/api/host.coffee +++ b/src/api/host.coffee @@ -217,7 +217,7 @@ exports.createNetwork = createNetwork # Throws an error if the host is not running the latest XS version listMissingPatches = $coroutine ({host}) -> - return @getXAPI(host).listMissingHostPatches(host) + return @getXAPI(host).listMissingPoolPatchesOnHost(host.id) listMissingPatches.params = { host: { type: 'string' } diff --git a/src/xapi.js b/src/xapi.js index 5652f8160..9b8189adc 100644 --- a/src/xapi.js +++ b/src/xapi.js @@ -267,12 +267,17 @@ export default class Xapi extends XapiBase { // ================================================================= - async listMissingHostPatches (host) { + async listMissingPoolPatchesOnHost (hostId) { + const { + software_version: {product_version: version}, + patches + } = this.getObject(hostId) + console.log return omit( - (await this._getXenUpdates()).versions[host.version].patches, + (await this._getXenUpdates()).versions[version].patches, // TODO: simplify when we start to use xen-api >= 0.5 - map(host.patches, ref => { + map(patches, ref => { const hostPatch = this.objects.all[this._refsToUuids[ref]] return this._refsToUuids[hostPatch.pool_patch] })