Removed default: '' and updated [] to '' per specification

This commit is contained in:
John Westcott IV
2020-08-04 13:06:13 -04:00
parent 8a0cd747e1
commit f2b9bdd552

View File

@@ -30,57 +30,46 @@ options:
organizations: organizations:
description: description:
- organization name to export - organization name to export
default: ''
type: str type: str
user: user:
description: description:
- user name to export - user name to export
default: ''
type: str type: str
team: team:
description: description:
- team name to export - team name to export
default: ''
type: str type: str
credential_type: credential_type:
description: description:
- credential type name to export - credential type name to export
default: ''
type: str type: str
credential: credential:
description: description:
- credential name to export - credential name to export
default: ''
type: str type: str
notification_template: notification_template:
description: description:
- notification template name to export - notification template name to export
default: ''
type: str type: str
inventory_script: inventory_script:
description: description:
- inventory script name to export - inventory script name to export
default: ''
type: str type: str
inventory: inventory:
description: description:
- inventory name to export - inventory name to export
default: ''
type: str type: str
project: project:
description: description:
- project name to export - project name to export
default: ''
type: str type: str
job_template: job_template:
description: description:
- job template name to export - job template name to export
default: ''
type: str type: str
workflow: workflow:
description: description:
- workflow name to export - workflow name to export
default: ''
type: str type: str
requirements: requirements:
- "awxkit >= 9.3.0" - "awxkit >= 9.3.0"
@@ -132,15 +121,15 @@ def main():
module.json_output['changed'] = False module.json_output['changed'] = False
# The exporter code currently works like the following: # The exporter code currently works like the following:
# Empty list == all assets of that type # Empty string == all assets of that type
# string = just one asset of that type (by name) # Non-Empty string = just one asset of that type (by name or ID)
# None = skip asset type # Asset type not present or None = skip asset type (unless everything is None, then export all)
# Here we are going to setup a dict of values to export # Here we are going to setup a dict of values to export
export_args = {} export_args = {}
for resource in EXPORTABLE_RESOURCES: for resource in EXPORTABLE_RESOURCES:
if module.params.get('all') or module.params.get(resource) == 'all': if module.params.get('all') or module.params.get(resource) == 'all':
# If we are exporting everything or we got the keyword "all" we pass in an empty list for this asset type # If we are exporting everything or we got the keyword "all" we pass in an empty string for this asset type
export_args[resource] = [] export_args[resource] = ''
else: else:
# Otherwise we take either the string or None (if the parameter was not passed) to get one or no items # Otherwise we take either the string or None (if the parameter was not passed) to get one or no items
export_args[resource] = module.params.get(resource) export_args[resource] = module.params.get(resource)