From 2608f38d64874aad31e5bc1f5e1d5fcfede38381 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 19 Oct 2022 13:18:12 -0400 Subject: [PATCH] Properly handle missing source_volume from OVAs --- api-daemon/pvcapid/vmbuilder.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api-daemon/pvcapid/vmbuilder.py b/api-daemon/pvcapid/vmbuilder.py index a2d8564a..88bc163d 100755 --- a/api-daemon/pvcapid/vmbuilder.py +++ b/api-daemon/pvcapid/vmbuilder.py @@ -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: