get_one now also returns the name field, and modifying modules for get_one and added in some IDs in a handful of unit tests

This commit is contained in:
John Westcott IV
2020-09-04 15:41:36 -04:00
parent 4c4d6dad49
commit 106157c600
34 changed files with 83 additions and 99 deletions

View File

@@ -109,10 +109,10 @@ def main():
module.fail_json(msg='Could not find Project with ID: {0}'.format(name))
project = results['json']['results'][0]
else:
lookup_data = {'name': name}
lookup_data = {}
if organization:
lookup_data['organization'] = module.resolve_name_to_id('organizations', organization)
project = module.get_one('projects', data=lookup_data)
project, name = module.get_one('projects', name_or_id=name, data=lookup_data)
if project is None:
module.fail_json(msg="Unable to find project")