fix(Xapi#createVbd): explicitly cast to boolean (#640)

Fixes vatesfr/xo-web#2558

Necessary because Xapi objects may contains integers instead of booleans.
This commit is contained in:
Julien Fontanet 2018-01-04 11:49:07 +01:00 committed by GitHub
parent 041c32a4a7
commit f9c942d526
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1588,14 +1588,14 @@ export default class Xapi extends XapiBase {
// By default a VBD is unpluggable. // By default a VBD is unpluggable.
const vbdRef = await this.call('VBD.create', { const vbdRef = await this.call('VBD.create', {
bootable, bootable: Boolean(bootable),
empty, empty: Boolean(empty),
mode, mode,
other_config, other_config,
qos_algorithm_params, qos_algorithm_params,
qos_algorithm_type, qos_algorithm_type,
type, type,
unpluggable, unpluggable: Boolean(unpluggable),
userdevice, userdevice,
VDI: vdi && vdi.$ref, VDI: vdi && vdi.$ref,
VM: vm.$ref, VM: vm.$ref,
@ -1635,8 +1635,8 @@ export default class Xapi extends XapiBase {
name_description, name_description,
name_label, name_label,
other_config, other_config,
read_only, read_only: Boolean(read_only),
sharable, sharable: Boolean(sharable),
sm_config, sm_config,
SR: sr.$ref, SR: sr.$ref,
tags, tags,