summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceEc2.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-16 08:55:13 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-16 08:55:13 -0700
commit13e1b680838615d8d54657641f84e6247ef5aea6 (patch)
tree42f9c2bda789eb1a5fe31d5e102aaede4a7d1a70 /cloudinit/sources/DataSourceEc2.py
parentb6421a971006288e6c2edc0cf6771c8fef57a66d (diff)
downloadvyos-cloud-init-13e1b680838615d8d54657641f84e6247ef5aea6.tar.gz
vyos-cloud-init-13e1b680838615d8d54657641f84e6247ef5aea6.zip
Fix pylint line length to big issue.
Diffstat (limited to 'cloudinit/sources/DataSourceEc2.py')
-rw-r--r--cloudinit/sources/DataSourceEc2.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/cloudinit/sources/DataSourceEc2.py b/cloudinit/sources/DataSourceEc2.py
index 0108954f..c2c3b9b7 100644
--- a/cloudinit/sources/DataSourceEc2.py
+++ b/cloudinit/sources/DataSourceEc2.py
@@ -198,13 +198,15 @@ class DataSourceEc2(sources.DataSource):
# 'ephemeral0': '/dev/sdb',
# 'root': '/dev/sda1'}
found = None
- for (entname, device) in self.metadata['block-device-mapping'].iteritems():
+ bdm_items = self.metadata['block-device-mapping'].iteritems()
+ for (entname, device) in bdm_items:
if entname == name:
found = device
break
# LP: #513842 mapping in Euca has 'ephemeral' not 'ephemeral0'
if entname == "ephemeral" and name == "ephemeral0":
found = device
+
if found is None:
LOG.debug("Unable to convert %s to a device", name)
return None
@@ -212,6 +214,7 @@ class DataSourceEc2(sources.DataSource):
ofound = found
if not found.startswith("/"):
found = "/dev/%s" % found
+
if os.path.exists(found):
return found