summaryrefslogtreecommitdiff
path: root/lib/ansible/module_utils/urls.py
diff options
context:
space:
mode:
authorFelix Fontein <felix@fontein.de>2018-09-19 17:53:16 +0200
committerMatt Martz <matt@sivel.net>2018-09-19 10:53:16 -0500
commitbc69aeca7f7c8187a304d139667338084037b63f (patch)
tree92f259e24e7c42bd11d8853409f7a7a91b31bcf8 /lib/ansible/module_utils/urls.py
parentd34cf93f1a7f96a14da1354b8f88a90c058e3e86 (diff)
downloadansible-bc69aeca7f7c8187a304d139667338084037b63f.tar.gz
Fixing HTTPError case of fetch_url for Python 3 compatibility. (#45628)
* Fixing HTTPError case of fetch_url for Python 3 compatibility. * Adding unit test. * PEP8. * Changelog.
Diffstat (limited to 'lib/ansible/module_utils/urls.py')
-rw-r--r--lib/ansible/module_utils/urls.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ansible/module_utils/urls.py b/lib/ansible/module_utils/urls.py
index 9434778e1f..c5e1632181 100644
--- a/lib/ansible/module_utils/urls.py
+++ b/lib/ansible/module_utils/urls.py
@@ -1303,7 +1303,8 @@ def fetch_url(module, url, data=None, headers=None, method=None,
# Try to add exception info to the output but don't fail if we can't
try:
- info.update(dict(**e.info()))
+ # Lowercase keys, to conform to py2 behavior, so that py3 and py2 are predictable
+ info.update(dict((k.lower(), v) for k, v in e.info().items()))
except:
pass