mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 01:17:37 -02:30
change except to get response instead of raise error
This commit is contained in:
@@ -73,7 +73,7 @@ def conjur_backend(**kwargs):
|
|||||||
except requests.exceptions.ConnectionError:
|
except requests.exceptions.ConnectionError:
|
||||||
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)
|
||||||
except:
|
except:
|
||||||
raise
|
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')
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ def conjur_backend(**kwargs):
|
|||||||
except requests.exceptions.ConnectionError:
|
except requests.exceptions.ConnectionError:
|
||||||
resp = requests.get(path_conjurcloud, timeout=30, **lookup_kwargs)
|
resp = requests.get(path_conjurcloud, timeout=30, **lookup_kwargs)
|
||||||
except:
|
except:
|
||||||
raise
|
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