Xapi#_setObjectProperties() gets the object type itself.

This commit is contained in:
Julien Fontanet 2015-05-14 15:53:54 +02:00
parent 41147483d8
commit 2a075d929a

View File

@ -209,8 +209,11 @@ export default class Xapi extends XapiBase {
// ================================================================= // =================================================================
async _setObjectProperties (type, id, props) { async _setObjectProperties (id, props) {
const {$ref: ref} = this.getObject(id) const {
$ref: ref,
$type: type
} = this.getObject(id)
// TODO: the thrown error should contain the name of the // TODO: the thrown error should contain the name of the
// properties that failed to be set. // properties that failed to be set.
@ -225,7 +228,7 @@ export default class Xapi extends XapiBase {
name_label, name_label,
name_description name_description
}) { }) {
await this._setObjectProperties('pool', this.pool.$id, { await this._setObjectProperties(this.pool.$id, {
name_label, name_label,
name_description name_description
}) })
@ -235,7 +238,7 @@ export default class Xapi extends XapiBase {
name_label, name_label,
name_description name_description
}) { }) {
await this._setObjectProperties('SR', id, { await this._setObjectProperties(id, {
name_label, name_label,
name_description name_description
}) })