From 88dfa795a039834f3509cb12aed9f50b9f44d05b Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Fri, 4 Oct 2013 17:29:25 -0400 Subject: try to support ephemeral0.1 in cc_mounts --- cloudinit/util.py | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'cloudinit/util.py') diff --git a/cloudinit/util.py b/cloudinit/util.py index f9957c67..9e6e0a73 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -1835,40 +1835,3 @@ def expand_dotted_devname(dotted): return toks else: return (dotted, None) - - -def devnode_for_dev_part(device, partition): - """ - Find the name of the partition. While this might seem rather - straight forward, its not since some devices are '' - while others are 'p'. For example, /dev/xvda3 on EC2 - will present as /dev/xvda3p1 for the first partition since /dev/xvda3 is - a block device. - """ - 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 - - if not os.path.exists(sys_path): - LOG.debug("did not find entry for %s in /sys/block", short_name) - return None - - sys_long_path = sys_path + "/" + short_name - valid_mappings = [sys_long_path + "%s" % partition, - sys_long_path + "p%s" % partition] - - for cdisk in valid_mappings: - if not os.path.exists(cdisk): - continue - - dev_path = "/dev/%s" % os.path.basename(cdisk) - if os.path.exists(dev_path): - return dev_path - - LOG.debug("Did not fine partition %s for device %s", partition, device) - return None -- cgit v1.2.3