mirror of
https://github.com/ansible/awx.git
synced 2026-04-06 18:49:21 -02:30
Fix misc. linter errors
This commit is contained in:
@@ -169,7 +169,7 @@ def main():
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% for association in associations[item_type] | default([]) %}
|
{% for association in associations[item_type] | default([]) %}
|
||||||
{{ association['related_item'] }}_ids = None
|
{{ association['related_item'] }}_ids = None
|
||||||
if {{ association['related_item'] }} != None:
|
if {{ association['related_item'] }} is not None:
|
||||||
{{ association['related_item'] }}_ids = []
|
{{ association['related_item'] }}_ids = []
|
||||||
for item in {{ association['related_item'] }}:
|
for item in {{ association['related_item'] }}:
|
||||||
{{ association['related_item'] }}_ids.append( module.resolve_name_to_id('{{ association['related_item'] }}', item) )
|
{{ association['related_item'] }}_ids.append( module.resolve_name_to_id('{{ association['related_item'] }}', item) )
|
||||||
@@ -194,7 +194,7 @@ def main():
|
|||||||
{% if option == name_option %}
|
{% if option == name_option %}
|
||||||
new_fields['{{ name_option }}'] = new_{{ name_option }} if new_{{ name_option }} else {{ name_option }}
|
new_fields['{{ name_option }}'] = new_{{ name_option }} if new_{{ name_option }} else {{ name_option }}
|
||||||
{% else %}
|
{% else %}
|
||||||
if {{ option }} != None:
|
if {{ option }} is not None:
|
||||||
{% if item['json']['actions']['POST'][option]['type'] == 'id' %}
|
{% if item['json']['actions']['POST'][option]['type'] == 'id' %}
|
||||||
new_fields['{{ option }}'] = {{ option }}_id
|
new_fields['{{ option }}'] = {{ option }}_id
|
||||||
{% else %}
|
{% else %}
|
||||||
@@ -203,10 +203,10 @@ def main():
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
if state == 'absent':
|
if state is 'absent':
|
||||||
# If the state was absent we can let the module delete it if needed, the module will handle exiting from this
|
# If the state was absent we can let the module delete it if needed, the module will handle exiting from this
|
||||||
module.delete_if_needed(existing_item)
|
module.delete_if_needed(existing_item)
|
||||||
elif state == 'present':
|
elif state is 'present':
|
||||||
# If the state was present and we can let the module build or update the existing item, this will return on its own
|
# If the state was present and we can let the module build or update the existing item, this will return on its own
|
||||||
module.create_or_update_if_needed(
|
module.create_or_update_if_needed(
|
||||||
existing_item, new_fields,
|
existing_item, new_fields,
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ associations:
|
|||||||
- related_item: credentials
|
- related_item: credentials
|
||||||
endpoint: credentials
|
endpoint: credentials
|
||||||
description: "The credentials used by this job template"
|
description: "The credentials used by this job template"
|
||||||
required: False
|
required: false
|
||||||
groups:
|
groups:
|
||||||
- related_item: hosts
|
- related_item: hosts
|
||||||
endpoint: hosts
|
endpoint: hosts
|
||||||
description: "The hosts associated with this group"
|
description: "The hosts associated with this group"
|
||||||
required: False
|
required: false
|
||||||
- related_item: groups
|
- related_item: groups
|
||||||
endpoint: children
|
endpoint: children
|
||||||
description: "The hosts associated with this group"
|
description: "The hosts associated with this group"
|
||||||
required: False
|
required: false
|
||||||
|
|||||||
Reference in New Issue
Block a user