summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2014-02-08 13:16:07 -0800
committerJoshua Harlow <harlowja@gmail.com>2014-02-08 13:16:07 -0800
commitea05883f88cedd5ed099aed19d4c5df563525097 (patch)
treeb1f445f7dcebc42e3c82c6e5637918e62dcca522 /cloudinit
parent098a74e6207f5d91f515fac63e970375d52795c0 (diff)
downloadvyos-cloud-init-ea05883f88cedd5ed099aed19d4c5df563525097.tar.gz
vyos-cloud-init-ea05883f88cedd5ed099aed19d4c5df563525097.zip
Capture IOError and use LOG better
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/sources/DataSourceConfigDrive.py2
-rw-r--r--cloudinit/sources/DataSourceOpenStack.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/cloudinit/sources/DataSourceConfigDrive.py b/cloudinit/sources/DataSourceConfigDrive.py
index 1d30fe08..142e0eb8 100644
--- a/cloudinit/sources/DataSourceConfigDrive.py
+++ b/cloudinit/sources/DataSourceConfigDrive.py
@@ -87,7 +87,7 @@ class DataSourceConfigDrive(openstack.SourceMixin, sources.DataSource):
md = util.mergemanydict([md, DEFAULT_METADATA])
user_dsmode = results.get('dsmode', None)
if user_dsmode not in VALID_DSMODES + (None,):
- LOG.warn("User specified invalid mode: %s" % user_dsmode)
+ LOG.warn("User specified invalid mode: %s", user_dsmode)
user_dsmode = None
dsmode = get_ds_mode(cfgdrv_ver=results['version'],
diff --git a/cloudinit/sources/DataSourceOpenStack.py b/cloudinit/sources/DataSourceOpenStack.py
index 2c50ed84..69807798 100644
--- a/cloudinit/sources/DataSourceOpenStack.py
+++ b/cloudinit/sources/DataSourceOpenStack.py
@@ -126,14 +126,14 @@ class DataSourceOpenStack(openstack.SourceMixin, sources.DataSource):
'version': openstack.OS_LATEST})
except openstack.NonReadable:
return False
- except openstack.BrokenMetadata:
+ except (openstack.BrokenMetadata, IOError):
util.logexc(LOG, "Broken metadata address %s",
self.metadata_address)
return False
user_dsmode = results.get('dsmode', None)
if user_dsmode not in VALID_DSMODES + (None,):
- LOG.warn("User specified invalid mode: %s" % user_dsmode)
+ LOG.warn("User specified invalid mode: %s", user_dsmode)
user_dsmode = None
if user_dsmode == 'disabled':
return False