diff options
author | Scott Moser <smoser@ubuntu.com> | 2013-10-04 17:29:25 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2013-10-04 17:29:25 -0400 |
commit | 88dfa795a039834f3509cb12aed9f50b9f44d05b (patch) | |
tree | e63361306711c57b70ee79871d59434ccf9840e2 /cloudinit/util.py | |
parent | 4846bff62e1a5e8f4edd216f900c27c55a319c5b (diff) | |
download | vyos-cloud-init-88dfa795a039834f3509cb12aed9f50b9f44d05b.tar.gz vyos-cloud-init-88dfa795a039834f3509cb12aed9f50b9f44d05b.zip |
try to support ephemeral0.1 in cc_mounts
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r-- | cloudinit/util.py | 37 |
1 files changed, 0 insertions, 37 deletions
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 '<device><partition>' - while others are '<device>p<partition>'. 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 |