Fix traceback in fetch_urls when status code is in info as well as the error.
This commit is contained in:
parent
772eafd61a
commit
6f23635cce
1 changed files with 2 additions and 1 deletions
|
@ -852,7 +852,8 @@ def fetch_url(module, url, data=None, headers=None, method=None,
|
|||
body = e.read()
|
||||
except AttributeError:
|
||||
body = ''
|
||||
info.update(dict(msg=str(e), status=e.code, body=body, **e.info()))
|
||||
info.update(dict(msg=str(e), body=body, **e.info()))
|
||||
info['status'] = e.code
|
||||
except urllib2.URLError, e:
|
||||
code = int(getattr(e, 'code', -1))
|
||||
info.update(dict(msg="Request failed: %s" % str(e), status=code))
|
||||
|
|
Loading…
Reference in a new issue