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

Allow empty values for ee in template #14975

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from
Open
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion awx_collection/plugins/modules/job_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,11 @@ def main():
search_fields['organization'] = new_fields['organization'] = organization_id

ee = module.params.get('execution_environment')
if ee:
if ee is not None:
if ee != '' and ee != 'None' and ee != '{}':

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could also be written as ee not in ['','None' ,'{}']. Could you explain why {} is needed?

new_fields['execution_environment'] = module.resolve_name_to_id('execution_environments', ee)
else:
new_fields['execution_environment'] = None

# Attempt to look up an existing item based on the provided data
existing_item = module.get_one('job_templates', name_or_id=name, check_exists=(state == 'exists'), **{'data': search_fields})
Expand Down
Loading