[master 2/4] Add isMounted to MountsCache

bcl installerbot-noreply at redhat.com
Tue Apr 7 19:22:19 UTC 2015


From: "Brian C. Lane" <bcl at 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


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/c20efffd4d56b238799bf0cc4128a95b7d03b910


More information about the anaconda-patches mailing list