summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_mounts.py
diff options
context:
space:
mode:
authorBen Howard <ben.howard@canonical.com>2013-10-03 16:15:56 -0600
committerBen Howard <ben.howard@canonical.com>2013-10-03 16:15:56 -0600
commitecf2a600e41a9632ad305eb6a8cd5665908f31fb (patch)
treedd8539cba663a5662187d7b68b49252d9877ca3e /cloudinit/config/cc_mounts.py
parentc3daa2fa160c930084509f4ef5abfbb562b7059d (diff)
downloadvyos-cloud-init-ecf2a600e41a9632ad305eb6a8cd5665908f31fb.tar.gz
vyos-cloud-init-ecf2a600e41a9632ad305eb6a8cd5665908f31fb.zip
Moved ephemeralX.Y handling from Datasource into the cc_disk_setup, which makes it cloud agnostic.
Diffstat (limited to 'cloudinit/config/cc_mounts.py')
-rw-r--r--cloudinit/config/cc_mounts.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/cloudinit/config/cc_mounts.py b/cloudinit/config/cc_mounts.py
index f4c2e3d8..6b47d326 100644
--- a/cloudinit/config/cc_mounts.py
+++ b/cloudinit/config/cc_mounts.py
@@ -217,14 +217,15 @@ def disk_or_part(device):
short_name = device.split('/')[-1]
sys_path = "/sys/block/%s" % short_name
- if not os.path.exists(sys_path):
- LOG.warn("Device %s does not exist in sysfs" % device)
- return None
+ # if the sys path does not exist but the device exists,
+ # then the device is a partition, no sense looking any further
+ if not os.path.exists(sys_path) and os.path.exists(device):
+ return device
sys_long_path = sys_path + "/" + short_name + "%s"
- valid_mappings = [ sys_long_path % "1",
- sys_long_path % "p1",
- sys_path ]
+ valid_mappings = [sys_long_path % "1",
+ sys_long_path % "p1",
+ sys_path]
for cdisk in valid_mappings:
if not os.path.exists(cdisk):