mirror of
https://github.com/ansible/awx.git
synced 2026-03-08 21:19:26 -02:30
Fixing get_one calls in tower_inventory_source_update
This commit is contained in:
@@ -107,17 +107,16 @@ def main():
|
|||||||
interval = module.params.get('interval')
|
interval = module.params.get('interval')
|
||||||
timeout = module.params.get('timeout')
|
timeout = module.params.get('timeout')
|
||||||
|
|
||||||
lookup_data = {'name': inventory}
|
lookup_data = {}
|
||||||
if organization:
|
if organization:
|
||||||
lookup_data['organization'] = module.resolve_name_to_id('organizations', organization)
|
lookup_data['organization'] = module.resolve_name_to_id('organizations', organization)
|
||||||
inventory_object = module.get_one('inventories', data=lookup_data)
|
inventory_object = module.get_one('inventories', name_or_id=inventory, data=lookup_data)
|
||||||
|
|
||||||
if not inventory_object:
|
if not inventory_object:
|
||||||
module.fail_json(msg='The specified inventory, {0}, was not found.'.format(lookup_data))
|
module.fail_json(msg='The specified inventory, {0}, was not found.'.format(lookup_data))
|
||||||
|
|
||||||
inventory_source_object = module.get_one('inventory_sources', **{
|
inventory_source_object = module.get_one('inventory_sources', name_or_id=inventory_source, **{
|
||||||
'data': {
|
'data': {
|
||||||
'name': inventory_source,
|
|
||||||
'inventory': inventory_object['id'],
|
'inventory': inventory_object['id'],
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user