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

@@ -134,9 +134,7 @@ def main():
# Attempt to look up the related items the user specified (these will fail the module if not found)
# Attempt to look up an existing item based on the provided data
existing_item = module.get_one('users', name_or_id=username)
# If we got an item back make sure the name field reflects the actual name (incase we were passed an ID)
username = existing_item['username'] if (existing_item) else username
existing_item, username = module.get_one('users', name_or_id=username)
if state == 'absent':
# If the state was absent we can let the module delete it if needed, the module will handle exiting from this