mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fixed requests HTTPError handler, it was still in urllib2 style
This commit is contained in:
parent
1a4cd6002f
commit
a3216f813d
1 changed files with 4 additions and 4 deletions
|
@ -122,10 +122,10 @@ def query(key, keyid, method='GET', params=None, headers=None,
|
|||
verify=verify_ssl)
|
||||
response = result.content
|
||||
except requests.exceptions.HTTPError as exc:
|
||||
log.error('There was an error::')
|
||||
if hasattr(exc, 'code') and hasattr(exc, 'msg'):
|
||||
log.error(' Code: {0}: {1}'.format(exc.code, exc.msg))
|
||||
log.error(' Content: \n{0}'.format(exc.read()))
|
||||
log.error('Failed to {0} {1}::'.format(method, requesturl))
|
||||
log.error(' Exception: {0}'.format(exc))
|
||||
if exc.response:
|
||||
log.error(' Response content: {0}'.format(exc.response.content))
|
||||
return False
|
||||
|
||||
log.debug('S3 Response Status Code: {0}'.format(result.status_code))
|
||||
|
|
Loading…
Add table
Reference in a new issue