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.
const vbdRef = await this.call('VBD.create', {
bootable,
empty,
bootable: Boolean(bootable),
empty: Boolean(empty),
mode,
other_config,
qos_algorithm_params,
qos_algorithm_type,
type,
unpluggable,
unpluggable: Boolean(unpluggable),
userdevice,
VDI: vdi && vdi.$ref,
VM: vm.$ref,
@ -1635,8 +1635,8 @@ export default class Xapi extends XapiBase {
name_description,
name_label,
other_config,
read_only,
sharable,
read_only: Boolean(read_only),
sharable: Boolean(sharable),
sm_config,
SR: sr.$ref,
tags,