aboutsummaryrefslogtreecommitdiffstats
path: root/mpm
diff options
context:
space:
mode:
Diffstat (limited to 'mpm')
-rw-r--r--mpm/python/usrp_mpm/sys_utils/mount.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/mpm/python/usrp_mpm/sys_utils/mount.py b/mpm/python/usrp_mpm/sys_utils/mount.py
index 3212a37cb..6dcadf03f 100644
--- a/mpm/python/usrp_mpm/sys_utils/mount.py
+++ b/mpm/python/usrp_mpm/sys_utils/mount.py
@@ -35,10 +35,11 @@ class Mount():
Returns true if the mount point is mounted
"""
assert self.devicepath is not None
- collection = [line.split()[0] for line in open("/etc/mtab")
- if line.split()[0] == self.devicepath]
- mounted = len(collection) != 0
- return mounted
+ with open("/etc/mtab") as mtab_f:
+ return any(
+ line.split()[0] == self.devicepath and line.split()[1] == self.mountpoint \
+ for line in mtab_f
+ )
def get_mount_point(self):
"""