]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tasks/cephfs: optionally stat() in background
authorJohn Spray <john.spray@redhat.com>
Mon, 14 Dec 2015 22:13:13 +0000 (22:13 +0000)
committerJohn Spray <john.spray@redhat.com>
Thu, 3 Mar 2016 21:56:47 +0000 (21:56 +0000)
Signed-off-by: John Spray <john.spray@redhat.com>
tasks/cephfs/mount.py

index a4c4df66329cf10d7319540016209aafdd5f1c53..865f4be370bf143ae4e44d228c0c2b6c776f2375 100644 (file)
@@ -460,7 +460,7 @@ class CephFSMount(object):
     def get_osd_epoch(self):
         raise NotImplementedError()
 
-    def stat(self, fs_path):
+    def stat(self, fs_path, wait=True):
         """
         stat a file, and return the result as a dictionary like this:
         {
@@ -492,8 +492,11 @@ class CephFSMount(object):
                 indent=2)
             """).format(path=abs_path)
         proc = self._run_python(pyscript)
-        proc.wait()
-        return json.loads(proc.stdout.getvalue().strip())
+        if wait:
+            proc.wait()
+            return json.loads(proc.stdout.getvalue().strip())
+        else:
+            return proc
 
     def path_to_ino(self, fs_path):
         abs_path = os.path.join(self.mountpoint, fs_path)