mounted_locations = mounts.get(realpath, [])
if destination:
- if destination.startswith('/'):
- destination = os.path.realpath(destination)
return destination in mounted_locations
return mounted_locations != []
destination exists
"""
mounts = get_mounts(devices=True)
- realpath = os.path.realpath(dev) if dev.startswith('/') else dev
destination = os.path.realpath(destination) if destination else None
- mounted_locations = mounts.get(realpath, [])
+ mounted_locations = mounts.get(dev, [])
if destination:
return destination in mounted_locations
fields = [as_string(f) for f in line.split()]
if len(fields) < 3:
continue
- device = os.path.realpath(fields[0]) if fields[0].startswith('/') else fields[0]
+ device = fields[0]
path = os.path.realpath(fields[1])
# only care about actual existing devices
if not os.path.exists(device) or not device.startswith('/'):