]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephfs/fuse_mount.py: by python3 compatible 34636/head
authorKefu Chai <kchai@redhat.com>
Mon, 20 Apr 2020 11:50:02 +0000 (19:50 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 20 Apr 2020 11:55:09 +0000 (19:55 +0800)
pass `StringIO()` to capture stdout whose value will be interpreted as a
string later on

Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/cephfs/fuse_mount.py

index 227d86e982a146bc7cf6f41e39b9506453a7b7c8..c4d78552839173f712b9cf77498aef6162e9e954 100644 (file)
@@ -1,4 +1,5 @@
 from io import BytesIO
+from io import StringIO
 import json
 import time
 import logging
@@ -101,6 +102,7 @@ class FuseMount(CephFSMount):
             )
             try:
                 ls_str = self.client_remote.sh("ls /sys/fs/fuse/connections",
+                                               stdout=StringIO(),
                                                timeout=(15*60)).strip()
             except CommandFailedError:
                 return []
@@ -447,14 +449,16 @@ print(find_socket("{client_name}"))
             client_name="client.{0}".format(self.client_id))
 
         # Find the admin socket
-        asok_path = self.client_remote.sh([
-            'sudo', 'python3', '-c', pyscript
-        ], timeout=(15*60)).strip()
+        asok_path = self.client_remote.sh(
+            ['sudo', 'python3', '-c', pyscript],
+            stdout=StringIO(),
+            timeout=(15*60)).strip()
         log.info("Found client admin socket at {0}".format(asok_path))
 
         # Query client ID from admin socket
         json_data = self.client_remote.sh(
             ['sudo', self._prefix + 'ceph', '--admin-daemon', asok_path] + args,
+            stdout=StringIO(),
             timeout=(15*60))
         return json.loads(json_data)