diff options
author | Scott Moser <smoser@ubuntu.com> | 2011-07-19 23:49:17 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2011-07-19 23:49:17 -0400 |
commit | 936132c0f9a7e8196b7d460581787ba4019bf5d4 (patch) | |
tree | 408c36d11672a6c5ee3eac3cdd72d0f8a0984337 /cloudinit/DataSourceEc2.py | |
parent | be623b70dbc7c591f14baa9314105e78bbe0f63f (diff) | |
download | vyos-cloud-init-936132c0f9a7e8196b7d460581787ba4019bf5d4.tar.gz vyos-cloud-init-936132c0f9a7e8196b7d460581787ba4019bf5d4.zip |
special case handling of mapping for ephemeral0
t1.micro do not have a ephemeral0 disk, but the metadata service will have
an entry there.
i386 t1.micro:
'block-device-mapping': {'ami': '/dev/sda1',
'ephemeral0': '/dev/sda2',
'root': '/dev/sda1'},
amd64 t1.micro:
'block-device-mapping': {'ami': '/dev/sda1',
'ephemeral0': '/dev/sdb',
'root': '/dev/sda1'},
LP: #744019
Diffstat (limited to 'cloudinit/DataSourceEc2.py')
-rw-r--r-- | cloudinit/DataSourceEc2.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cloudinit/DataSourceEc2.py b/cloudinit/DataSourceEc2.py index 4abb6e47..890569e3 100644 --- a/cloudinit/DataSourceEc2.py +++ b/cloudinit/DataSourceEc2.py @@ -176,7 +176,7 @@ class DataSourceEc2(DataSource.DataSource): if entname == "ephemeral" and name == "ephemeral0": found = device if found == None: - log.warn("unable to convert %s to a device" % name) + log.debug("unable to convert %s to a device" % name) return None # LP: #611137 @@ -201,6 +201,14 @@ class DataSourceEc2(DataSource.DataSource): if os.path.exists(cand): log.debug("remapped device name %s => %s" % (found,cand)) return(cand) + + # on t1.micro, ephemeral0 will appear in block-device-mapping from + # metadata, but it will not exist on disk (and never will) + # at this pint, we've verified that the path did not exist + # in the special case of 'ephemeral0' return None to avoid bogus + # fstab entry (LP: #744019) + if name == "ephemeral0": + return None return ofound def is_vpc(self): |