Skip to content

Commit

Permalink
Merge pull request ansible#7270 from john-westcott-iv/fix_tower_setti…
Browse files Browse the repository at this point in the history
…ngs_none

Prevent exception for Non value

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
  • Loading branch information
softwarefactory-project-zuul[bot] committed Jun 8, 2020
2 parents 40b020c + b457c8f commit e5ec761
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions awx_collection/plugins/modules/tower_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@


def coerce_type(module, value):
# If our value is already None we can just return directly
if value is None:
return value

yaml_ish = bool((
value.startswith('{') and value.endswith('}')
) or (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,14 @@
- assert:
that:
- "result is changed"

- name: Handle an omit value
tower_settings:
name: AWX_PROOT_BASE_PATH
value: '{{ junk_var | default(omit) }}'
register: result
ignore_errors: true

- assert:
that:
- "'Unable to update settings' in result.msg"

0 comments on commit e5ec761

Please sign in to comment.