summaryrefslogtreecommitdiff
path: root/cloudinit/url_helper.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2013-03-13 22:28:39 -0700
committerJoshua Harlow <harlowja@gmail.com>2013-03-13 22:28:39 -0700
commit6ded151bd19d27cd03e22dbf2e98914b12504c78 (patch)
tree767f5dc6a487e370abb961d063b97e5cafa92479 /cloudinit/url_helper.py
parentf22388a04076247490c02f605b176c3c45ecd425 (diff)
downloadvyos-cloud-init-6ded151bd19d27cd03e22dbf2e98914b12504c78.tar.gz
vyos-cloud-init-6ded151bd19d27cd03e22dbf2e98914b12504c78.zip
Update to handle requests >= 1.0 which doesn't use the config dict.
Diffstat (limited to 'cloudinit/url_helper.py')
-rw-r--r--cloudinit/url_helper.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/cloudinit/url_helper.py b/cloudinit/url_helper.py
index 6f06761a..08e5f01b 100644
--- a/cloudinit/url_helper.py
+++ b/cloudinit/url_helper.py
@@ -34,7 +34,7 @@ LOG = logging.getLogger(__name__)
# Check if requests has ssl support (added in requests >= 0.8.8)
SSL_ENABLED = False
-CONFIG_ENABLED = False # This was added in 0.7
+CONFIG_ENABLED = False # This was added in 0.7 (but taken out in >=1.0)
try:
import pkg_resources
from distutils.version import LooseVersion
@@ -42,7 +42,7 @@ try:
_REQ_VER = LooseVersion(_REQ.version)
if _REQ_VER >= LooseVersion('0.8.8'):
SSL_ENABLED = True
- if _REQ_VER >= LooseVersion('0.7.0'):
+ if _REQ_VER >= LooseVersion('0.7.0') and _REQ_VER < LooseVersion('1.0.0'):
CONFIG_ENABLED = True
except:
pass
@@ -129,8 +129,8 @@ def readurl(url, data=None, timeout=None, retries=0, sec_between=1,
if data:
req_args['method'] = 'POST'
# It doesn't seem like config
- # was added in older library versions, thus we
- # need to manually do the retries if it wasn't
+ # was added in older library versions (or newer ones either), thus we
+ # need to manually do the retries if it wasn't...
if CONFIG_ENABLED:
req_config = {
'store_cookies': False,