From c186015d6f01cb07d7ceae3e1a1f0134421b0177 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 13 Jul 2024 17:13:40 -0400 Subject: [PATCH] Add check for invalid profile --- daemon-common/vmbuilder.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/daemon-common/vmbuilder.py b/daemon-common/vmbuilder.py index db53a76a..9a7ff5b7 100644 --- a/daemon-common/vmbuilder.py +++ b/daemon-common/vmbuilder.py @@ -258,6 +258,13 @@ def worker_create_vm( args = (vm_profile,) db_cur.execute(query, args) profile_data = db_cur.fetchone() + if profile_data is None: + fail( + celery, + f'Provisioner profile "{vm_profile}" is not present on the cluster', + exception=ClusterError, + ) + if profile_data.get("arguments"): vm_data["script_arguments"] = profile_data.get("arguments").split("|") else: