support SMB ISO SR

This commit is contained in:
Olivier Lambert 2016-03-03 18:25:43 +01:00
parent ce0333b0a7
commit eb21a1bfb3

View File

@ -88,11 +88,18 @@ export async function createIso ({
// FIXME: won't work for IPv6
// Detect if NFS or local path for ISO files
const deviceConfig = {location: path}
const deviceConfig = {}
if (path.indexOf(':') === -1) { // not NFS share
// TODO: legacy will be removed in XAPI soon by FileSR
deviceConfig.legacy_mode = 'true'
if (path.indexOf('\\') === -1) { // not SMB
deviceConfig.legacy_mode = 'true'
} else {
path = path.replace(/\\/g, '/')
}
}
deviceConfig.location = path
deviceConfig.username = user
deviceConfig.cifspassword = password
const srRef = await xapi.call(
'SR.create',
host._xapiRef,