summaryrefslogtreecommitdiffstats
path: root/qa/tasks/cephfs/mount.py
diff options
context:
space:
mode:
Diffstat (limited to 'qa/tasks/cephfs/mount.py')
-rw-r--r--qa/tasks/cephfs/mount.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/qa/tasks/cephfs/mount.py b/qa/tasks/cephfs/mount.py
index 4a8187406..bd92cadaa 100644
--- a/qa/tasks/cephfs/mount.py
+++ b/qa/tasks/cephfs/mount.py
@@ -195,10 +195,10 @@ class CephFSMount(object):
self.fs = Filesystem(self.ctx, name=self.cephfs_name)
try:
- output = self.fs.mon_manager.raw_cluster_cmd(args='osd blocklist ls')
+ output = self.fs.get_ceph_cmd_stdout('osd blocklist ls')
except CommandFailedError:
# Fallback for older Ceph cluster
- output = self.fs.mon_manager.raw_cluster_cmd(args='osd blacklist ls')
+ output = self.fs.get_ceph_cmd_stdout('osd blacklist ls')
return self.addr in output
@@ -740,15 +740,19 @@ class CephFSMount(object):
if perms:
self.run_shell(args=f'chmod {perms} {path}')
- def read_file(self, path):
+ def read_file(self, path, sudo=False):
"""
Return the data from the file on given path.
"""
if path.find(self.hostfs_mntpt) == -1:
path = os.path.join(self.hostfs_mntpt, path)
- return self.run_shell(args=['cat', path]).\
- stdout.getvalue().strip()
+ args = []
+ if sudo:
+ args.append('sudo')
+ args += ['cat', path]
+
+ return self.run_shell(args=args, omit_sudo=False).stdout.getvalue().strip()
def create_destroy(self):
assert(self.is_mounted())