summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceEc2.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-02-13 06:27:22 -0500
committerScott Moser <smoser@ubuntu.com>2014-02-13 06:27:22 -0500
commitc722a6e9110b8a5dc33de8911cf5734e14dc523f (patch)
tree54acbaf93371fc42f2777f68e79768e45f47a0a7 /cloudinit/sources/DataSourceEc2.py
parent5788cd903f6e4a9bab2ad32e9c1d2eb13b485ac3 (diff)
parentf7ac086a434b511b076346839818de7cf34e18a2 (diff)
downloadvyos-cloud-init-c722a6e9110b8a5dc33de8911cf5734e14dc523f.tar.gz
vyos-cloud-init-c722a6e9110b8a5dc33de8911cf5734e14dc523f.zip
merge from trunk
Diffstat (limited to 'cloudinit/sources/DataSourceEc2.py')
-rw-r--r--cloudinit/sources/DataSourceEc2.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/cloudinit/sources/DataSourceEc2.py b/cloudinit/sources/DataSourceEc2.py
index f010e640..1b20ecf3 100644
--- a/cloudinit/sources/DataSourceEc2.py
+++ b/cloudinit/sources/DataSourceEc2.py
@@ -92,12 +92,9 @@ class DataSourceEc2(sources.DataSource):
except Exception:
util.logexc(LOG, "Failed to get max wait. using %s", max_wait)
- if max_wait == 0:
- return False
-
timeout = 50
try:
- timeout = int(mcfg.get("timeout", timeout))
+ timeout = max(0, int(mcfg.get("timeout", timeout)))
except Exception:
util.logexc(LOG, "Failed to get timeout, using %s", timeout)
@@ -109,6 +106,8 @@ class DataSourceEc2(sources.DataSource):
mcfg = {}
(max_wait, timeout) = self._get_url_settings()
+ if max_wait <= 0:
+ return False
# Remove addresses from the list that wont resolve.
mdurls = mcfg.get("metadata_urls", DEF_MD_URLS)