mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 06:29:31 -02:30
Modifying credential for new get_one
This commit is contained in:
@@ -365,13 +365,14 @@ def main():
|
||||
|
||||
# Attempt to look up the object based on the provided name, credential type and optional organization
|
||||
lookup_data = {
|
||||
'name': name,
|
||||
'credential_type': cred_type_id,
|
||||
}
|
||||
if organization:
|
||||
lookup_data['organization'] = org_id
|
||||
|
||||
credential = module.get_one('credentials', **{'data': lookup_data})
|
||||
credential = module.get_one('credentials', name_or_id=name, **{'data': lookup_data})
|
||||
# If we got an item back make sure the name field reflects the actual name (incase we were passed an ID)
|
||||
name = credential['name'] if (credential) else name
|
||||
|
||||
if state == 'absent':
|
||||
# If the state was absent we can let the module delete it if needed, the module will handle exiting from this
|
||||
|
||||
Reference in New Issue
Block a user