From 8ede74a7f694804864f27072ddc42eed8079acc7 Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Wed, 9 Jun 2021 10:19:26 -0400 Subject: [PATCH] Deal with the possibility of get_default_pod_spec not finding an EE --- awx/main/utils/execution_environments.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/awx/main/utils/execution_environments.py b/awx/main/utils/execution_environments.py index 8598b7024f..5bc01d879a 100644 --- a/awx/main/utils/execution_environments.py +++ b/awx/main/utils/execution_environments.py @@ -17,6 +17,9 @@ def get_default_execution_environment(): def get_default_pod_spec(): + ee = get_default_execution_environment() + if ee is None: + raise RuntimeError("Unable to find an execution environment.") return { "apiVersion": "v1", @@ -25,7 +28,7 @@ def get_default_pod_spec(): "spec": { "containers": [ { - "image": get_default_execution_environment().image, + "image": ee.image, "name": 'worker', "args": ['ansible-runner', 'worker', '--private-data-dir=/runner'], }