Hack to delete orphaned organizations, consolidate get_one methods

minor test update

Updating the message if more than one object is found

Update test to new message
This commit is contained in:
Alan Rominger
2020-09-09 14:10:51 -04:00
parent ff7c2e9180
commit a73323f3d6
7 changed files with 107 additions and 86 deletions

View File

@@ -129,12 +129,7 @@ def main():
resource_name = params.get(param)
if resource_name:
resource = module.get_one_by_name_or_id(module.param_to_endpoint(param), resource_name)
if not resource:
module.fail_json(
msg='Failed to update role, {0} not found in {1}'.format(param, endpoint),
changed=False
)
resource = module.get_exactly_one(module.param_to_endpoint(param), resource_name)
resource_data[param] = resource
# separate actors from resources