From 10d99782809706eb0edbaf5d619c4182d3a26065 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 4 Mar 2010 15:44:48 -0500 Subject: in ebs root instances, ephemeral0 will have a full path. In instance store I was used to block-device-mapping: {'ami': 'sda1', 'ephemeral0': 'sda2', 'root': '/dev/sda1', 'swap': 'sda3'}, in ebs, image registered with '--block-device-mapping /dev/sda2=ephemeral0', metadata is showing block-device-mapping: {'ami': '/dev/sda1', 'ephemeral0': '/dev/sda2', 'root': '/dev/sda1', 'swap': 'sda3'}, Without this change, 'ephemeral0' would not get translated and would show up in /etc/fstab. --- cloudinit/CloudConfig.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cloudinit/CloudConfig.py') diff --git a/cloudinit/CloudConfig.py b/cloudinit/CloudConfig.py index 73cf4e3a..9eb2d00b 100644 --- a/cloudinit/CloudConfig.py +++ b/cloudinit/CloudConfig.py @@ -323,7 +323,9 @@ class CloudConfig(): for defmnt in defmnts: devname = self.cloud.device_name_to_device(defmnt[0]) if devname is None: continue - if not devname.startswith("/"): + if devname.startswith("/"): + defmnt[0] = devname + else: defmnt[0] = "/dev/%s" % devname cfgmnt_has = False -- cgit v1.2.3