Do not XO & XAPI objects.

This commit is contained in:
Julien Fontanet 2015-05-06 15:36:20 +02:00
parent 898244d04d
commit f9dd00b79b
2 changed files with 9 additions and 4 deletions

View File

@ -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' }

View File

@ -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]
})