feat(vm.importBackup): returns the new VM id (#345)

This commit is contained in:
Fabrice Marsaud 2016-06-20 18:07:14 +02:00 committed by Julien Fontanet
parent d02358ac0d
commit 9460822529
2 changed files with 3 additions and 4 deletions

View File

@ -804,9 +804,7 @@ exports.backup = backup
#---------------------------------------------------------------------
importBackup = $coroutine ({remote, file, sr}) ->
yield @importVmBackup(remote, file, sr)
return
importBackup = ({remote, file, sr}) -> @importVmBackup(remote, file, sr)
importBackup.permission = 'admin'
importBackup.description = 'Imports a VM into host, from a file found in the chosen remote'

View File

@ -106,7 +106,8 @@ export default class {
const stream = await handler.createReadStream(file)
const xapi = this._xo.getXapi(sr)
await xapi.importVm(stream, { srId: sr._xapiId })
const vm = await xapi.importVm(stream, { srId: sr._xapiId })
return xapiObjectToXo(vm).id
}
// -----------------------------------------------------------------