mirror of
https://github.com/ceph/ceph
synced 2025-02-21 18:17:42 +00:00
tasks/cephfs: optionally stat() in background
Signed-off-by: John Spray <john.spray@redhat.com>
This commit is contained in:
parent
7a97fcbe42
commit
67b711dee5
@ -460,7 +460,7 @@ class CephFSMount(object):
|
|||||||
def get_osd_epoch(self):
|
def get_osd_epoch(self):
|
||||||
raise NotImplementedError()
|
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:
|
stat a file, and return the result as a dictionary like this:
|
||||||
{
|
{
|
||||||
@ -492,8 +492,11 @@ class CephFSMount(object):
|
|||||||
indent=2)
|
indent=2)
|
||||||
""").format(path=abs_path)
|
""").format(path=abs_path)
|
||||||
proc = self._run_python(pyscript)
|
proc = self._run_python(pyscript)
|
||||||
proc.wait()
|
if wait:
|
||||||
return json.loads(proc.stdout.getvalue().strip())
|
proc.wait()
|
||||||
|
return json.loads(proc.stdout.getvalue().strip())
|
||||||
|
else:
|
||||||
|
return proc
|
||||||
|
|
||||||
def path_to_ino(self, fs_path):
|
def path_to_ino(self, fs_path):
|
||||||
abs_path = os.path.join(self.mountpoint, fs_path)
|
abs_path = os.path.join(self.mountpoint, fs_path)
|
||||||
|
Loading…
Reference in New Issue
Block a user