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