]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephfs/fuse_mount.py: by python3 compatible
authorKefu Chai <kchai@redhat.com>
Mon, 20 Apr 2020 11:50:02 +0000 (19:50 +0800)
committerNathan Cutler <ncutler@suse.com>
Tue, 16 Jun 2020 16:51:31 +0000 (18:51 +0200)
pass `StringIO()` to capture stdout whose value will be interpreted as a
string later on

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit c5bd318de65866b4992314c2fb0e82090b4d2979)

qa/tasks/cephfs/fuse_mount.py

index b8380eebda62951b19e9f1ba275249a1f0ef307f..539a98715c53697d42963fbca7aebe33919cbac2 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)