From: Xiubo Li Date: Thu, 23 Apr 2020 11:39:31 +0000 (-0400) Subject: qa/tasks/vstart_runner: remove the stdin str type check X-Git-Tag: v14.2.10~17^2~30 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b71e42e1d1ee60837a2534d97a604f03b9e39c58;p=ceph.git qa/tasks/vstart_runner: remove the stdin str type check For the "ceph-dencoder" it will use the byte type data. Signed-off-by: Xiubo Li (cherry picked from commit bf10478294e26dc785dd79b0367bf096e9f67b42) --- diff --git a/qa/tasks/cephfs/filesystem.py b/qa/tasks/cephfs/filesystem.py index 4b8b0c719a1a..4be74abfded9 100644 --- a/qa/tasks/cephfs/filesystem.py +++ b/qa/tasks/cephfs/filesystem.py @@ -1065,7 +1065,7 @@ class Filesystem(MDSCluster): os.path.join(self._prefix, "rados"), "-p", pool, "getxattr", obj_name, xattr_name ] try: - proc = remote.run(args=args, stdout=StringIO()) + proc = remote.run(args=args, stdout=BytesIO()) except CommandFailedError as e: log.error(e.__str__()) raise ObjectNotFound(obj_name) diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index 481db91216b1..0e0183778678 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -291,12 +291,12 @@ class LocalRemote(object): env=env) if stdin: - if not isinstance(stdin, str): - raise RuntimeError("Can't handle non-string stdins on a vstart cluster") - # Hack: writing to stdin is not deadlock-safe, but it "always" works # as long as the input buffer is "small" - subproc.stdin.write(stdin.encode()) + if isinstance(stdin, str): + subproc.stdin.write(stdin.encode()) + else: + subproc.stdin.write(stdin) proc = LocalRemoteProcess( args, subproc, check_status,