]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/cephfs: add CephFSMount.ls
authorJohn Spray <jspray@redhat.com>
Wed, 17 Jun 2015 09:52:00 +0000 (10:52 +0100)
committerJohn Spray <jspray@redhat.com>
Wed, 17 Jun 2015 13:06:23 +0000 (14:06 +0100)
Just a helper for functions that inspect
the contents of the mount, such as in
test_data_scan

Signed-off-by: John Spray <john.spray@redhat.com>
tasks/cephfs/mount.py

index 55f79be512b361611817aed4813aa4fa433ee487..52646804f551e6292abd145486b17917e7289a3a 100644 (file)
@@ -419,3 +419,12 @@ class CephFSMount(object):
         proc = self._run_python(pyscript)
         proc.wait()
         return int(proc.stdout.getvalue().strip())
+
+    def ls(self, path=None):
+        """
+        Wrap ls: return a list of strings
+        """
+        cmd = ["ls"]
+        if path:
+            cmd.append(path)
+        return self.run_shell(cmd).stdout.getvalue().strip().split("\n")