Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not add env vars if they do not add content #15637

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions awx/main/tasks/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,10 @@
config_values = read_ansible_config(os.path.join(private_data_dir, 'project'), list(map(lambda x: x[1], path_vars)))

for env_key, config_setting, folder, default in path_vars:
local_folder = os.path.join(private_data_dir, folder)

Check warning on line 938 in awx/main/tasks/jobs.py

View check run for this annotation

Codecov / codecov/patch

awx/main/tasks/jobs.py#L938

Added line #L938 was not covered by tests
if (not os.path.exists(local_folder)) or (os.listdir(local_folder) == []):
# If there is no content populated in the additional content folder, do not set the env var
continue

Check warning on line 941 in awx/main/tasks/jobs.py

View check run for this annotation

Codecov / codecov/patch

awx/main/tasks/jobs.py#L941

Added line #L941 was not covered by tests
paths = default.split(':')
if env_key in env:
for path in env[env_key].split(':'):
Expand Down
Loading