1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #15851 from sivel/py24-urllib2-code

Use .code instead of .getcode() as py24 does not have .getcode()
This commit is contained in:
Adrian Likins 2016-05-13 12:20:41 -04:00
commit 28771960a1

View file

@ -893,7 +893,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, url_password=password, http_agent=http_agent, force_basic_auth=force_basic_auth,
follow_redirects=follow_redirects) follow_redirects=follow_redirects)
info.update(r.info()) info.update(r.info())
info.update(dict(msg="OK (%s bytes)" % r.headers.get('Content-Length', 'unknown'), url=r.geturl(), status=r.getcode())) info.update(dict(msg="OK (%s bytes)" % r.headers.get('Content-Length', 'unknown'), url=r.geturl(), status=r.code))
except NoSSLError: except NoSSLError:
e = get_exception() e = get_exception()
distribution = get_distribution() distribution = get_distribution()