mirror of
https://github.com/ansible/awx.git
synced 2026-03-10 14:09:28 -02:30
rename 'approle_auth_path' to 'default_auth_path' & fix kwargs.get
This commit is contained in:
@@ -41,11 +41,12 @@ base_inputs = {
|
||||
'secret': True,
|
||||
'help_text': _('The Secret ID for AppRole Authentication')
|
||||
}, {
|
||||
'id': 'approle_auth_path',
|
||||
'id': 'default_auth_path',
|
||||
'label': _('Path to Approle Auth'),
|
||||
'type': 'string',
|
||||
'multiline': False,
|
||||
'help_text': _('The path where the AppRole Authentication method is mounted e.g, approle')
|
||||
'default': 'approle',
|
||||
'help_text': _('The AppRole Authentication path to use if one isn\'t provided in the metadata when linking to an input field. Defaults to \'approle\'')
|
||||
}
|
||||
],
|
||||
'metadata': [{
|
||||
@@ -126,10 +127,8 @@ def approle_auth(**kwargs):
|
||||
role_id = kwargs['role_id']
|
||||
secret_id = kwargs['secret_id']
|
||||
# we first try to use the 'auth_path' from the metadata
|
||||
# if not found we try to fetch the 'approle_auth_path' from inputs
|
||||
# if not found we use the default value 'approle'
|
||||
auth_path = \
|
||||
kwargs.get('auth_path', kwargs.get('approle_auth_path', "approle"))
|
||||
# if not found we try to fetch the 'default_auth_path' from inputs
|
||||
auth_path = kwargs.get('auth_path') or kwargs['default_auth_path']
|
||||
|
||||
url = urljoin(kwargs['url'], 'v1')
|
||||
cacert = kwargs.get('cacert', None)
|
||||
|
||||
Reference in New Issue
Block a user