From 13e1b680838615d8d54657641f84e6247ef5aea6 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Sat, 16 Jun 2012 08:55:13 -0700 Subject: Fix pylint line length to big issue. --- cloudinit/sources/DataSourceEc2.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cloudinit') 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 -- cgit v1.2.3