Skip to content

Commit

Permalink
Merge pull request ceph#1786 from rishabh-d-dave/orch-mount-method
Browse files Browse the repository at this point in the history
  • Loading branch information
zmc authored Sep 22, 2022
2 parents 2386aae + 8fa6ac1 commit a773b06
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions teuthology/orchestra/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,21 @@ def sudo_write_file(self, path, data, **kwargs):
"""
self.write_file(path, data, sudo=True, **kwargs)

def is_mounted(self, path):
"""
Check if the given path is mounted on the remote machine.
This method checks the contents of "/proc/self/mounts" instead of
using "mount" or "findmnt" command since these commands hang when a
CephFS client is blocked and its mount point on the remote machine
is left unhandled/unmounted.
:param path: path on remote host
"""
# XXX: matching newline too is crucial so that "/mnt" does not match
# "/mnt/cephfs" if it's present in the output.
return f'{path}\n' in self.sh("cat /proc/self/mounts | awk '{print $2}'")

@property
def os(self):
if not hasattr(self, '_os'):
Expand Down

0 comments on commit a773b06

Please sign in to comment.