VMs actions work.
This commit is contained in:
parent
6a6dddfef1
commit
1de8f9a92a
@ -322,8 +322,8 @@ class $MappedCollection
|
|||||||
if remove
|
if remove
|
||||||
$_.extend(itemsToRemove, @_byKey)
|
$_.extend(itemsToRemove, @_byKey)
|
||||||
|
|
||||||
$_.each items, (value, key) =>
|
$_.each items, (value, generatorKey) =>
|
||||||
key = @_key value, key
|
key = @_key value, generatorKey
|
||||||
|
|
||||||
# If the item already existed.
|
# If the item already existed.
|
||||||
if @_byKey[key]?
|
if @_byKey[key]?
|
||||||
@ -336,6 +336,7 @@ class $MappedCollection
|
|||||||
|
|
||||||
# Compute the new value.
|
# Compute the new value.
|
||||||
item.generator = value
|
item.generator = value
|
||||||
|
item.generatorKey = generatorKey
|
||||||
$computeValue this, rule, item
|
$computeValue this, rule, item
|
||||||
|
|
||||||
# Runs related hooks.
|
# Runs related hooks.
|
||||||
@ -352,11 +353,13 @@ class $MappedCollection
|
|||||||
return unless rule
|
return unless rule
|
||||||
|
|
||||||
# Adds the item.
|
# Adds the item.
|
||||||
item = @_byKey[key] = @_byRule[rule.name][key] =
|
item = @_byKey[key] = @_byRule[rule.name][key] = {
|
||||||
_ruleName: rule.name
|
_ruleName: rule.name
|
||||||
key: key
|
key
|
||||||
value: undefined
|
value: undefined
|
||||||
generator: value
|
generator: value
|
||||||
|
generatorKey
|
||||||
|
}
|
||||||
|
|
||||||
# Computes the value.
|
# Computes the value.
|
||||||
$computeValue this, rule, item
|
$computeValue this, rule, item
|
||||||
|
@ -162,13 +162,13 @@ var $register = function (path, fn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var current = Api.fn;
|
var current = Api.fn;
|
||||||
for (var i = 0, n = path.length; i < n; ++i)
|
for (var i = 0, n = path.length - 1; i < n; ++i)
|
||||||
{
|
{
|
||||||
var component = path[i];
|
var component = path[i];
|
||||||
current = (current[component] || (current[component] = {}));
|
current = (current[component] || (current[component] = {}));
|
||||||
}
|
}
|
||||||
|
|
||||||
current.fn = fn;
|
current[path[n]] = fn;
|
||||||
};
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
@ -543,9 +543,9 @@ _.each({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Gets the corresponding connection.
|
// Gets the corresponding connection.
|
||||||
var xapi = this.xo.connections[vm.$pool];
|
var xapi = this.xo.xapis[vm.$pool];
|
||||||
|
|
||||||
xapi.call('VM.'+ method, p_id);
|
xapi.call('VM.'+ method, vm.$ref);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
@ -403,6 +403,9 @@ module.exports = (refsToUUIDs) ->
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# The reference is necessary for operations with the XAPI.
|
||||||
|
$ref: -> @generatorKey
|
||||||
|
|
||||||
'VM-controller':
|
'VM-controller':
|
||||||
extends: 'VM'
|
extends: 'VM'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user