summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2013-10-07 20:08:13 -0400
committerScott Moser <smoser@ubuntu.com>2013-10-07 20:08:13 -0400
commit16a2bff998f6553ac13b7f0acaf6c0f24feecc83 (patch)
tree9e81053b6bebbbb67c853d573593635fecf02b07 /cloudinit
parent5ae77733c75776b59cb75a5aa634e2965d97339f (diff)
parent92b196693410b57e7d1f94eb557513b1aad177ff (diff)
downloadvyos-cloud-init-16a2bff998f6553ac13b7f0acaf6c0f24feecc83.tar.gz
vyos-cloud-init-16a2bff998f6553ac13b7f0acaf6c0f24feecc83.zip
fix bug mounting first partition of a alias'd name.
The expected behavior was that 'ephemeral0' in a mount device entry and ephemeral0 mapped to /dev/xvdb that /dev/xvdb1 or /dev/xvdb would be substituted. Explicitly setting 'ephemeral0.0' would mean only xvdb in this case. LP: #1236594
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/config/cc_mounts.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/cloudinit/config/cc_mounts.py b/cloudinit/config/cc_mounts.py
index 84ec928f..80590118 100644
--- a/cloudinit/config/cc_mounts.py
+++ b/cloudinit/config/cc_mounts.py
@@ -222,9 +222,6 @@ def devnode_for_dev_part(device, partition):
if not os.path.exists(device):
return None
- if not partition:
- return device
-
short_name = os.path.basename(device)
sys_path = "/sys/block/%s" % short_name
@@ -238,8 +235,7 @@ def devnode_for_dev_part(device, partition):
partition = str(partition)
if partition is None:
- valid_mappings = [sys_long_path + "1",
- sys_long_path + "p1" % partition]
+ valid_mappings = [sys_long_path + "1", sys_long_path + "p1"]
elif partition != "0":
valid_mappings = [sys_long_path + "%s" % partition,
sys_long_path + "p%s" % partition]