Handle not-provided falsy values in tower_inventory_source

This commit is contained in:
AlanCoding
2020-07-29 21:55:20 -04:00
parent b444d10369
commit 750c22a150
2 changed files with 27 additions and 5 deletions

View File

@@ -77,7 +77,6 @@ options:
description:
- Delete child groups and hosts not found in source.
type: bool
default: 'no'
overwrite_vars:
description:
- Override vars in child groups and hosts with those from external source.
@@ -86,7 +85,6 @@ options:
description:
- Local absolute file path containing a custom Python virtualenv to use.
type: str
default: ''
timeout:
description: The amount of time (in seconds) to run before the task is canceled.
type: int
@@ -98,7 +96,6 @@ options:
description:
- Refresh inventory data from its source each time a job is run.
type: bool
default: 'no'
update_cache_timeout:
description:
- Time in seconds to consider an inventory sync to be current.
@@ -173,7 +170,7 @@ def main():
group_by=dict(),
overwrite=dict(type='bool'),
overwrite_vars=dict(type='bool'),
custom_virtualenv=dict(default=''),
custom_virtualenv=dict(),
timeout=dict(type='int'),
verbosity=dict(type='int', choices=[0, 1, 2]),
update_on_launch=dict(type='bool'),
@@ -257,7 +254,7 @@ def main():
# Layer in all remaining optional information
for field_name in OPTIONAL_VARS:
field_val = module.params.get(field_name)
if field_val:
if field_val is not None:
inventory_source_fields[field_name] = field_val
# Attempt to JSON encode source vars