1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Remove extraneous call to bool built-in function

This commit is contained in:
Pierre-Louis Bonicoli 2020-03-11 17:20:18 +01:00 committed by Ryan Petrello
parent d3d4ce3804
commit 9fdd9061d3
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

View File

@ -109,10 +109,10 @@ hashi_ssh_inputs['required'].extend(['public_key', 'role'])
def handle_auth(**kwargs): def handle_auth(**kwargs):
result = None result = None
if bool(kwargs.get('token')): if kwargs.get('token'):
result = kwargs['token'] result = kwargs['token']
else: else:
if bool(kwargs.get('role_id')) and bool(kwargs.get('secret_id')): if kwargs.get('role_id') and kwargs.get('secret_id'):
result = approle_auth(**kwargs) result = 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')
@ -124,7 +124,7 @@ def approle_auth(**kwargs):
secret_id = kwargs['secret_id'] secret_id = kwargs['secret_id']
auth_path = "approle" auth_path = "approle"
if bool(kwargs.get('auth_path')): if kwargs.get('auth_path'):
auth_path = kwargs.get('auth_path', "approle") auth_path = kwargs.get('auth_path', "approle")
url = urljoin(kwargs['url'], 'v1') url = urljoin(kwargs['url'], 'v1')