From bd2208e8f674d7c6025092d2f6b15cc40ffa7165 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 21 Oct 2022 14:13:40 -0400 Subject: [PATCH] Add ova as valid name in addition to default_ova --- api-daemon/pvcapid/ova.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/api-daemon/pvcapid/ova.py b/api-daemon/pvcapid/ova.py index a69208ca..147d4a6a 100755 --- a/api-daemon/pvcapid/ova.py +++ b/api-daemon/pvcapid/ova.py @@ -168,14 +168,16 @@ def delete_ova(zkhandler, name): @ZKConnection(config) def upload_ova(zkhandler, pool, name, ova_size): - # Check that we have a default_ova provisioning script - _, retcode = provisioner.list_script("default_ova", is_fuzzy=False) + # Check that we have an ova or default_ova provisioning script + _, retcode = provisioner.list_script("ova", is_fuzzy=False) if retcode != 200: - output = { - "message": "Did not find a 'default_ova' provisioning script. Please add one with that name, either the example from '/usr/share/pvc/provisioner/examples/script/2-ova.py' or a custom one, before uploading OVAs." - } - retcode = 400 - return output, retcode + _, retcode = provisioner.list_script("default_ova", is_fuzzy=False) + if retcode != 200: + output = { + "message": "Did not find a 'default_ova' provisioning script. Please add one with that name, either the example from '/usr/share/pvc/provisioner/examples/script/2-ova.py' or a custom one, before uploading OVAs." + } + retcode = 400 + return output, retcode ova_archive = None