Properly handle missing source_volume from OVAs

This commit is contained in:
Joshua Boniface 2022-10-19 13:18:12 -04:00
parent 89f05ced3f
commit 2608f38d64
1 changed files with 5 additions and 2 deletions

View File

@ -447,9 +447,12 @@ def create_vm(
# Verify that every specified filesystem is valid
used_filesystems = list()
for volume in vm_data["volumes"]:
if volume["source_volume"] is not None:
if volume.get("source_volume") is not None:
continue
if volume["filesystem"] and volume["filesystem"] not in used_filesystems:
if (
volume.get("filesystem") is not None
and volume["filesystem"] not in used_filesystems
):
used_filesystems.append(volume["filesystem"])
for filesystem in used_filesystems: