From bbbd0b7b24acf45507b50a7bfd542e91a8fc7cee Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 8 Mar 2020 13:39:59 +0800 Subject: [PATCH] qa/tasks/ceph_manager: capture stderr for COT as we are expecting the error message written to stderr, and we need to check for the error messages in it. this change addresses the regression introduced by 204ceee156cbb8a20bdf56efb0cd0610ee4c107e Fixes: https://tracker.ceph.com/issues/44500 Signed-off-by: Kefu Chai --- qa/tasks/ceph_manager.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index 130182f25da..f8afa98835d 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -258,7 +258,8 @@ class Thrasher: stdout=BytesIO(), stderr=BytesIO()) if proc.exitstatus == 0: break - elif proc.exitstatus == 1 and proc.stderr == b"OSD has the store locked": + elif (proc.exitstatus == 1 and + six.ensure_str(proc.stderr.getvalue()) == "OSD has the store locked"): continue else: raise Exception("ceph-objectstore-tool: " @@ -324,8 +325,8 @@ class Thrasher: proc = imp_remote.run(args=cmd, wait=True, check_status=False, stderr=BytesIO()) if proc.exitstatus == 1: - bogosity = b"The OSD you are using is older than the exported PG" - if bogosity in proc.stderr.getvalue(): + bogosity = "The OSD you are using is older than the exported PG" + if bogosity in six.ensure_str(proc.stderr.getvalue()): self.log("OSD older than exported PG" "...ignored") elif proc.exitstatus == 10: -- 2.47.3