Changing how get_one returns

This commit is contained in:
John Westcott IV
2020-09-08 11:02:25 -04:00
parent 106157c600
commit 0a8db586d1
25 changed files with 76 additions and 100 deletions

View File

@@ -134,7 +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, username = module.get_one('users', name_or_id=username)
existing_item = 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
@@ -143,7 +143,7 @@ def main():
# Create the data that gets sent for create and update
new_fields = {}
if username:
new_fields['username'] = username
new_fields['username'] = module.get_item_name(existing_item) if existing_item else name
if first_name:
new_fields['first_name'] = first_name
if last_name: