From: "Brian C. Lane" bcl@redhat.com
Check to see if a mountpoint path is already mounted. --- blivet/mounts.py | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/blivet/mounts.py b/blivet/mounts.py index 069a970..a2cd208 100644 --- a/blivet/mounts.py +++ b/blivet/mounts.py @@ -50,6 +50,15 @@ def getMountpoint(self, devspec, subvolspec=None):
return self.mountpoints.get((devspec, subvolspec))
+ def isMounted(self, mountpoint): + """ Check to see if a path is already mounted + + :param str mountpoint: Path to check for + """ + self._cacheCheck() + + return mountpoint in self.mountpoints.values() + def _getActiveMounts(self): """ Get information about mounted devices from /proc/mounts and /proc/self/mountinfo