Created
December 16, 2014 18:32
-
-
Save keshavab/f34bb63d93025bdff2b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_devices(device_dir, logger): | |
devices = [] | |
for line in open('/proc/mounts').readlines(): | |
data = line.strip().split() | |
block_device = data[0] | |
mount_point = data[1] | |
if mount_point.startswith(device_dir): | |
device = {} | |
device['mount_point'] = mount_point | |
device['block_device'] = block_device | |
try: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment