mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-15 07:48:38 -05:00
Prefer installer defaults over user-defined global EEs
Add a basic level of testing around get_default_execution_environment
This commit is contained in:
@@ -13,6 +13,11 @@ def get_control_plane_execution_environment():
|
||||
def get_default_execution_environment():
|
||||
if settings.DEFAULT_EXECUTION_ENVIRONMENT is not None:
|
||||
return settings.DEFAULT_EXECUTION_ENVIRONMENT
|
||||
installed_default = ExecutionEnvironment.objects.filter(
|
||||
image__in=[ee['image'] for ee in settings.GLOBAL_JOB_EXECUTION_ENVIRONMENTS], organization=None, managed_by_tower=False
|
||||
).first()
|
||||
if installed_default:
|
||||
return installed_default
|
||||
return ExecutionEnvironment.objects.filter(organization=None, managed_by_tower=False).first()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user