1
0
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:
Pierre-Louis Bonicoli 2020-03-11 17:21:46 +01:00 committed by Ryan Petrello
parent 9fdd9061d3
commit 9d85e8655d
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

View File

@ -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']