change except to get response instead of raise error

This commit is contained in:
Joe Garcia 2023-01-20 11:40:51 -05:00
parent 4470b80059
commit d8e7c59fe8
No known key found for this signature in database
GPG Key ID: 7D51948B87699A95

View File

@ -73,7 +73,7 @@ def conjur_backend(**kwargs):
except requests.exceptions.ConnectionError:
resp = requests.post(urljoin(url, '/'.join(['api', 'authn', account, username, 'authenticate'])), **auth_kwargs)
except:
raise
resp = requests.post(urljoin(url, '/'.join(['api', 'authn', account, username, 'authenticate'])), **auth_kwargs)
raise_for_status(resp)
token = resp.content.decode('utf-8')
@ -97,7 +97,7 @@ def conjur_backend(**kwargs):
except requests.exceptions.ConnectionError:
resp = requests.get(path_conjurcloud, timeout=30, **lookup_kwargs)
except:
raise
resp = requests.get(path_conjurcloud, timeout=30, **lookup_kwargs)
raise_for_status(resp)
return resp.text