mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
Merge pull request #13528 from infamousjoeg/fix-13527-conjur-exception-bug
Fixes #13527 CyberArk Conjur Secrets Manager Lookup Exception Bug
This commit is contained in:
@@ -70,7 +70,8 @@ def conjur_backend(**kwargs):
|
|||||||
auth_kwargs['verify'] = cert
|
auth_kwargs['verify'] = cert
|
||||||
try:
|
try:
|
||||||
resp = requests.post(urljoin(url, '/'.join(['authn', account, username, 'authenticate'])), **auth_kwargs)
|
resp = requests.post(urljoin(url, '/'.join(['authn', account, username, 'authenticate'])), **auth_kwargs)
|
||||||
except requests.exceptions.ConnectionError:
|
resp.raise_for_status()
|
||||||
|
except requests.exceptions.HTTPError:
|
||||||
resp = requests.post(urljoin(url, '/'.join(['api', 'authn', account, username, 'authenticate'])), **auth_kwargs)
|
resp = requests.post(urljoin(url, '/'.join(['api', 'authn', account, username, 'authenticate'])), **auth_kwargs)
|
||||||
raise_for_status(resp)
|
raise_for_status(resp)
|
||||||
token = resp.content.decode('utf-8')
|
token = resp.content.decode('utf-8')
|
||||||
@@ -92,7 +93,8 @@ def conjur_backend(**kwargs):
|
|||||||
lookup_kwargs['verify'] = cert
|
lookup_kwargs['verify'] = cert
|
||||||
try:
|
try:
|
||||||
resp = requests.get(path, timeout=30, **lookup_kwargs)
|
resp = requests.get(path, timeout=30, **lookup_kwargs)
|
||||||
except requests.exceptions.ConnectionError:
|
resp.raise_for_status()
|
||||||
|
except requests.exceptions.HTTPError:
|
||||||
resp = requests.get(path_conjurcloud, timeout=30, **lookup_kwargs)
|
resp = requests.get(path_conjurcloud, timeout=30, **lookup_kwargs)
|
||||||
raise_for_status(resp)
|
raise_for_status(resp)
|
||||||
return resp.text
|
return resp.text
|
||||||
|
|||||||
Reference in New Issue
Block a user