mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Touching up to missing sport of get_one returning multiple params
This commit is contained in:
parent
c2cfaec7d1
commit
4c0e288fee
@ -453,7 +453,7 @@ def main():
|
||||
new_fields['inventory'] = module.resolve_name_to_id('inventories', inventory)
|
||||
if project is not None:
|
||||
if organization_id is not None:
|
||||
project_data, project = module.get_one('projects', name_or_id=project, **{
|
||||
project_data = module.get_one('projects', name_or_id=project, **{
|
||||
'data': {
|
||||
'organization': organization_id,
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ def main():
|
||||
{% endfor %}
|
||||
|
||||
# Attempt to look up an existing item based on the provided data
|
||||
existing_item, name = module.get_one('{{ item_type }}', name_or_id={{ name_option }}, **{
|
||||
existing_item = module.get_one('{{ item_type }}', name_or_id={{ name_option }}, **{
|
||||
'data': {
|
||||
{% if 'organization' in item['json']['actions']['POST'] and item['json']['actions']['POST']['organization']['type'] == 'id' %}
|
||||
'organization': org_id,
|
||||
@ -194,7 +194,7 @@ def main():
|
||||
new_fields = {}
|
||||
{% for option in item['json']['actions']['POST'] %}
|
||||
{% 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 (module.get_item_name(existing_item) if existing_item else {{ name_option }}t)
|
||||
{% else %}
|
||||
if {{ option }} is not None:
|
||||
{% if item['json']['actions']['POST'][option]['type'] == 'id' %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user