Use correct host to import VM without known length.

This commit is contained in:
Julien Fontanet 2015-11-13 16:53:00 +01:00
parent 92f24b5728
commit c676f08a7c

View File

@ -898,9 +898,9 @@ export default class Xapi extends XapiBase {
)
}
async _putVmWithoutLength (stream, query) {
async _putVmWithoutLength (hostname, stream, query) {
const request = httpRequest({
hostname: this.pool.$master.address,
hostname,
method: 'PUT',
path: '/import/?' + formatQueryString(query)
})
@ -946,7 +946,7 @@ export default class Xapi extends XapiBase {
headers: { 'content-length': length },
query
})
: this._putVmWithoutLength(stream, query)
: this._putVmWithoutLength(host.address, stream, query)
const [, vmRef] = await Promise.all([
upload,