mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
Both methods return a token: rename variable
This commit is contained in:
parent
9fdd9061d3
commit
9d85e8655d
@ -107,17 +107,17 @@ hashi_ssh_inputs['metadata'] = [{
|
||||
hashi_ssh_inputs['required'].extend(['public_key', 'role'])
|
||||
|
||||
def handle_auth(**kwargs):
|
||||
result = None
|
||||
token = None
|
||||
|
||||
if kwargs.get('token'):
|
||||
result = kwargs['token']
|
||||
token = kwargs['token']
|
||||
else:
|
||||
if kwargs.get('role_id') and kwargs.get('secret_id'):
|
||||
result = approle_auth(**kwargs)
|
||||
token = approle_auth(**kwargs)
|
||||
else:
|
||||
raise Exception('Either Vault token or Auth parameters must be set')
|
||||
|
||||
return result
|
||||
return token
|
||||
|
||||
def approle_auth(**kwargs):
|
||||
role_id = kwargs['role_id']
|
||||
|
Loading…
Reference in New Issue
Block a user