From 407356239b72fdee3d0f7ce021cba44e0fa4c10a Mon Sep 17 00:00:00 2001 From: John Westcott IV Date: Thu, 15 Oct 2020 12:40:31 -0400 Subject: [PATCH] Fixing get_one calls in tower_inventory_source_update --- .../plugins/modules/tower_inventory_source_update.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/awx_collection/plugins/modules/tower_inventory_source_update.py b/awx_collection/plugins/modules/tower_inventory_source_update.py index c4cb27be7c..945cd304b5 100644 --- a/awx_collection/plugins/modules/tower_inventory_source_update.py +++ b/awx_collection/plugins/modules/tower_inventory_source_update.py @@ -107,17 +107,16 @@ def main(): interval = module.params.get('interval') timeout = module.params.get('timeout') - lookup_data = {'name': inventory} + lookup_data = {} if 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: 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': { - 'name': inventory_source, 'inventory': inventory_object['id'], } })