mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 06:10:22 -07:00
Don't override the http status code when successful in urls.py
This commit is contained in:
parent
7833b5bec4
commit
ed35e8bce2
2 changed files with 8 additions and 2 deletions
|
@ -887,8 +887,7 @@ def fetch_url(module, url, data=None, headers=None, method=None,
|
|||
url_password=password, http_agent=http_agent, force_basic_auth=force_basic_auth,
|
||||
follow_redirects=follow_redirects)
|
||||
info.update(r.info())
|
||||
info['url'] = r.geturl() # The URL goes in too, because of redirects.
|
||||
info.update(dict(msg="OK (%s bytes)" % r.headers.get('Content-Length', 'unknown'), status=200))
|
||||
info.update(dict(msg="OK (%s bytes)" % r.headers.get('Content-Length', 'unknown'), url=r.geturl(), status=r.getcode()))
|
||||
except NoSSLError, e:
|
||||
distribution = get_distribution()
|
||||
if distribution is not None and distribution.lower() == 'redhat':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue