diff options
author | Scott Moser <smoser@ubuntu.com> | 2014-02-12 12:14:49 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2014-02-12 12:14:49 -0500 |
commit | dd1c392eeae8324e59d34d8d448e74cfda6d1712 (patch) | |
tree | 7f0236e34eb0f1770219d6c636c81eaf318f02e8 /cloudinit/sources/DataSourceEc2.py | |
parent | 65da76341796a00b7bbdca514167b89f99d5a599 (diff) | |
parent | 4d80411700ca70401cda401ee9bca799b9b8c55d (diff) | |
download | vyos-cloud-init-dd1c392eeae8324e59d34d8d448e74cfda6d1712.tar.gz vyos-cloud-init-dd1c392eeae8324e59d34d8d448e74cfda6d1712.zip |
merge from trunk
Diffstat (limited to 'cloudinit/sources/DataSourceEc2.py')
-rw-r--r-- | cloudinit/sources/DataSourceEc2.py | 7 |
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) |