Skip to content

Commit

Permalink
Add isMounted to MountsCache
Browse files Browse the repository at this point in the history
Check to see if a mountpoint path is already mounted.
  • Loading branch information
bcl committed Apr 7, 2015
1 parent 6ef9a09 commit c20efff
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions blivet/mounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c20efff

Please sign in to comment.