From 72a59f1c55f6820aefb5983d7e160673ecc6941d Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 20 Apr 2020 19:50:02 +0800 Subject: [PATCH] qa/tasks/cephfs/fuse_mount.py: by python3 compatible pass `StringIO()` to capture stdout whose value will be interpreted as a string later on Signed-off-by: Kefu Chai (cherry picked from commit c5bd318de65866b4992314c2fb0e82090b4d2979) --- qa/tasks/cephfs/fuse_mount.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/qa/tasks/cephfs/fuse_mount.py b/qa/tasks/cephfs/fuse_mount.py index 61d28e38ee52b..28e892b9d5d06 100644 --- a/qa/tasks/cephfs/fuse_mount.py +++ b/qa/tasks/cephfs/fuse_mount.py @@ -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 [] @@ -433,14 +435,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) -- 2.39.5