fix(xapi/VDI_importContent): format is not optional

This commit is contained in:
Julien Fontanet 2022-07-21 15:02:00 +02:00
parent af4cc1f574
commit 6c08afaa0e
2 changed files with 4 additions and 0 deletions

View File

@ -1,5 +1,6 @@
'use strict'
const assert = require('node:assert').strict
const CancelToken = require('promise-toolbox/CancelToken')
const pCatch = require('promise-toolbox/catch')
const pRetry = require('promise-toolbox/retry')
@ -86,6 +87,8 @@ class Vdi {
}
async importContent(ref, stream, { cancelToken = CancelToken.none, format }) {
assert.notEqual(format, undefined)
if (stream.length === undefined) {
throw new Error('Trying to import a VDI without a length field. Please report this error to Xen Orchestra.')
}

View File

@ -30,6 +30,7 @@
<!--packages-start-->
- @vates/async-each major
- @xen-orchestra/xapi patch
- xo-cli patch
- xo-web patch