More tolerant parsing of VM-template.disks.
This commit is contained in:
parent
db97787b15
commit
153dca8137
@ -239,11 +239,12 @@ export function vm (obj) {
|
||||
arch: otherConfig['install-arch'],
|
||||
disks: (function () {
|
||||
const {disks: xml} = otherConfig
|
||||
if (!xml) {
|
||||
let data
|
||||
if (!xml || !(data = parseXml(xml)).provision) {
|
||||
return []
|
||||
}
|
||||
|
||||
const disks = ensureArray(parseXml(xml).provision.disk)
|
||||
const disks = ensureArray(data.provision.disk)
|
||||
forEach(disks, function normalize (disk) {
|
||||
disk.bootable = disk.bootable === 'true'
|
||||
disk.size = +disk.size
|
||||
|
Loading…
Reference in New Issue
Block a user