Skip to content

Instantly share code, notes, and snippets.

@keshavab
Created December 16, 2014 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keshavab/f34bb63d93025bdff2b7 to your computer and use it in GitHub Desktop.
Save keshavab/f34bb63d93025bdff2b7 to your computer and use it in GitHub Desktop.
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