summaryrefslogtreecommitdiff
path: root/cloudinit/sources/helpers
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2014-02-08 17:29:52 -0800
committerJoshua Harlow <harlowja@gmail.com>2014-02-08 17:29:52 -0800
commit5788cd903f6e4a9bab2ad32e9c1d2eb13b485ac3 (patch)
treedee32865247fe482ee9c8af0a42b6c574247555a /cloudinit/sources/helpers
parent1597aca9b0606d02c045549afce4395370502231 (diff)
downloadvyos-cloud-init-5788cd903f6e4a9bab2ad32e9c1d2eb13b485ac3.tar.gz
vyos-cloud-init-5788cd903f6e4a9bab2ad32e9c1d2eb13b485ac3.zip
Handle code not existing in older requests versions
Diffstat (limited to 'cloudinit/sources/helpers')
-rw-r--r--cloudinit/sources/helpers/openstack.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/cloudinit/sources/helpers/openstack.py b/cloudinit/sources/helpers/openstack.py
index 09fb4ad8..a17148d3 100644
--- a/cloudinit/sources/helpers/openstack.py
+++ b/cloudinit/sources/helpers/openstack.py
@@ -408,8 +408,13 @@ class MetadataReader(BaseReader):
def _path_exists(self, path):
def should_retry_cb(request, cause):
- if cause.code >= 400:
- return False
+ try:
+ code = int(cause.code)
+ if code >= 400:
+ return False
+ except (TypeError, ValueError):
+ # Older versions of requests didn't have a code.
+ pass
return True
try: