summaryrefslogtreecommitdiff
path: root/cloudinit/sources
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/sources')
-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: