summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-09-10 14:39:59 -0400
committerScott Moser <smoser@ubuntu.com>2014-09-10 14:39:59 -0400
commit1b975098ea2cc82a168203c720ef936db4864467 (patch)
treefa0d8c1455ae96c5777b52686e391db2cea386bb /cloudinit
parentb76f489dc594c352b285b0239b0ce872ccf3511d (diff)
downloadvyos-cloud-init-1b975098ea2cc82a168203c720ef936db4864467.tar.gz
vyos-cloud-init-1b975098ea2cc82a168203c720ef936db4864467.zip
log as warn if things are obviously wrong
If something is broken as in a built in config, or code just broken, then logging warning during search for metadata is ok.
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/sources/DataSourceOpenStack.py16
-rw-r--r--cloudinit/sources/helpers/openstack.py6
2 files changed, 12 insertions, 10 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)
diff --git a/cloudinit/sources/helpers/openstack.py b/cloudinit/sources/helpers/openstack.py
index 7b27621c..0c6b9b5a 100644
--- a/cloudinit/sources/helpers/openstack.py
+++ b/cloudinit/sources/helpers/openstack.py
@@ -178,8 +178,10 @@ class BaseReader(object):
break
if selected_version != version:
- LOG.debug("Version '%s' not available, attempting to use"
- " version '%s' instead", version, selected_version)
+ LOG.warn("Version '%s' not available, attempting to use "
+ "version '%s' instead", version, selected_version)
+ else:
+ LOG.debug("Version '%s' was available.", version)
return selected_version
def _read_content_path(self, item):