mirror of
https://github.com/ansible/awx.git
synced 2026-05-23 00:37:37 -02:30
properly handle Galaxy credentials if a Project is orphaned
This commit is contained in:
@@ -2030,6 +2030,7 @@ class RunProjectUpdate(BaseTask):
|
||||
|
||||
# build out env vars for Galaxy credentials (in order)
|
||||
galaxy_server_list = []
|
||||
if project_update.project.organization:
|
||||
for i, cred in enumerate(
|
||||
project_update.project.organization.galaxy_credentials.all()
|
||||
):
|
||||
@@ -2118,7 +2119,10 @@ class RunProjectUpdate(BaseTask):
|
||||
elif not scm_branch:
|
||||
scm_branch = {'hg': 'tip'}.get(project_update.scm_type, 'HEAD')
|
||||
|
||||
galaxy_creds_are_defined = project_update.project.organization.galaxy_credentials.exists()
|
||||
galaxy_creds_are_defined = (
|
||||
project_update.project.organization and
|
||||
project_update.project.organization.galaxy_credentials.exists()
|
||||
)
|
||||
if not galaxy_creds_are_defined and (
|
||||
settings.AWX_ROLES_ENABLED or settings.AWX_COLLECTIONS_ENABLED
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user