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