From 5d92965b31800bd7106e6f40fe4fc78b07e6f2e9 Mon Sep 17 00:00:00 2001 From: Christopher Hoffman Date: Tue, 18 Oct 2022 20:14:19 +0000 Subject: qa/tasks: Include stderr on tasks badness check. Make sure that first_in_ceph_log() doesn't return None (which is treated as success/"no badness" by the caller) if the cluster log file is missing. Fixes: https://tracker.ceph.com/issues/57864 Co-authored-by: Ilya Dryomov Signed-off-by: Christopher Hoffman Signed-off-by: Ilya Dryomov --- qa/tasks/cephadm.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'qa/tasks/cephadm.py') diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index dab61c2c700..0cde6050718 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -475,12 +475,16 @@ def ceph_log(ctx, config): run.Raw('|'), 'head', '-n', '1', ]) r = ctx.ceph[cluster_name].bootstrap_remote.run( - stdout=StringIO(), + stdout=BytesIO(), args=args, + stderr=StringIO(), ) - stdout = r.stdout.getvalue() - if stdout != '': + stdout = r.stdout.getvalue().decode() + if stdout: return stdout + stderr = r.stderr.getvalue() + if stderr: + return stderr return None # NOTE: technically the first and third arg to first_in_ceph_log -- cgit v1.2.3