diff options
author | Scott Moser <smoser@ubuntu.com> | 2014-09-10 15:03:54 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2014-09-10 15:03:54 -0400 |
commit | 67f198ceb6dfeb82b2d3f78955d21d09d43fa7db (patch) | |
tree | 3a80c0dd7c92ce0c3766ca19f6b035037ea4d4c0 /cloudinit/sources/DataSourceOpenStack.py | |
parent | 91a5bf5fb67a147e2f434407d1449e745dc1ba3f (diff) | |
parent | 64f4a63c174a4f7c21e6e372927906099103d64c (diff) | |
download | vyos-cloud-init-67f198ceb6dfeb82b2d3f78955d21d09d43fa7db.tar.gz vyos-cloud-init-67f198ceb6dfeb82b2d3f78955d21d09d43fa7db.zip |
openstack: fix bug referencing undefined variable, revert some changes
I had leaked in a couple exception loud-ness changes previously.
This does fix one bug in that os_versions was not defined.
Diffstat (limited to 'cloudinit/sources/DataSourceOpenStack.py')
-rw-r--r-- | cloudinit/sources/DataSourceOpenStack.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cloudinit/sources/DataSourceOpenStack.py b/cloudinit/sources/DataSourceOpenStack.py index 221759e1..0970d07b 100644 --- a/cloudinit/sources/DataSourceOpenStack.py +++ b/cloudinit/sources/DataSourceOpenStack.py @@ -64,13 +64,13 @@ class DataSourceOpenStack(openstack.SourceMixin, sources.DataSource): try: max_wait = int(self.ds_cfg.get("max_wait", max_wait)) - except Exception as e: - LOG.debug("Failed to get max wait. using %s: %s", max_wait, e) + except Exception: + util.logexc(LOG, "Failed to get max wait. using %s", max_wait) try: timeout = max(0, int(self.ds_cfg.get("timeout", timeout))) - except Exception as e: - LOG.debug("Failed to get timeout, using %s: %s", timeout, e) + except Exception: + util.logexc(LOG, "Failed to get timeout, using %s", timeout) return (max_wait, timeout) def wait_for_metadata_service(self): @@ -82,7 +82,7 @@ class DataSourceOpenStack(openstack.SourceMixin, sources.DataSource): if len(filtered): urls = filtered else: - LOG.debug("Empty metadata url list! using default list") + LOG.warn("Empty metadata url list! using default list") urls = [DEF_MD_URL] md_urls = [] @@ -123,9 +123,9 @@ class DataSourceOpenStack(openstack.SourceMixin, sources.DataSource): 'version': openstack.OS_HAVANA}) except openstack.NonReadable: return False - except (openstack.BrokenMetadata, IOError) as e: - LOG.debug("Broken metadata address %s: %s", - self.metadata_address, e) + except (openstack.BrokenMetadata, IOError): + util.logexc(LOG, "Broken metadata address %s", + self.metadata_address) return False user_dsmode = results.get('dsmode', None) |