From bf10478294e26dc785dd79b0367bf096e9f67b42 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Thu, 23 Apr 2020 07:39:31 -0400 Subject: [PATCH] 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 --- qa/tasks/cephfs/filesystem.py | 2 +- qa/tasks/vstart_runner.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/qa/tasks/cephfs/filesystem.py b/qa/tasks/cephfs/filesystem.py index 1398fb5060e49..60877ed63a4f5 100644 --- a/qa/tasks/cephfs/filesystem.py +++ b/qa/tasks/cephfs/filesystem.py @@ -1094,7 +1094,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 d6a69066255e6..6e4403c6ef5b7 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -390,12 +390,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, -- 2.39.5