From 13ba3c34d2144beafccb3d4519e416fa51d96d37 Mon Sep 17 00:00:00 2001 From: Bartek Grzybowski Date: Tue, 28 May 2019 13:59:13 +0200 Subject: [PATCH] Always show healthcheck output if it was run This patch changes the default behavior of showing healthcheck script results. So far output was printed only in increased verbosity mode but the proper action should be to print it whenever it was called. A bug in exec_healthcheck() routine is also fixed (subprocess.check_output() returns byte string, not an object with 'output' attribute). Change-Id: Ifd7294de9bed321123f74977f881999ce69cf878 Issue-ID: OOM-1806 Signed-off-by: Bartek Grzybowski --- helm_deployment_status.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/helm_deployment_status.py b/helm_deployment_status.py index 20521329..7f8954f2 100755 --- a/helm_deployment_status.py +++ b/helm_deployment_status.py @@ -106,7 +106,7 @@ def exec_healthcheck(hp_script, namespace): hc = subprocess.check_output( ['sh', hp_script, namespace, 'health'], stderr=subprocess.STDOUT) - return 0, hc.output + return 0, hc except subprocess.CalledProcessError as err: return err.returncode, err.output @@ -297,8 +297,7 @@ def main(): hc_rc, hc_output = exec_healthcheck(args.health_path, args.namespace) except IOError as err: sys.exit(err.strerror) - if args.verbosity > 1 or hc_rc > 0: - print(hc_output.decode('utf-8')) + print(hc_output.decode('utf-8')) sys.exit(hc_rc) if not ready: -- 2.16.6