summaryrefslogtreecommitdiffstats
path: root/helm_deployment_status.py
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-05-28 13:59:13 +0200
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-05-28 13:59:13 +0200
commit13ba3c34d2144beafccb3d4519e416fa51d96d37 (patch)
tree49a5bbdaaac89f0e48e132dd9139d12810069290 /helm_deployment_status.py
parent929f0905e6bf1b370dae729d657962d9d75d6041 (diff)
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 <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'helm_deployment_status.py')
-rwxr-xr-xhelm_deployment_status.py5
1 files 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: