Fix missing import in helm_deployment_status.py 07/89807/2
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>
Thu, 13 Jun 2019 13:44:01 +0000 (15:44 +0200)
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>
Thu, 13 Jun 2019 14:14:12 +0000 (16:14 +0200)
After recent changes a regression emerged due to
not properly imported 'subprocess' module 'check_output'
function.

Predefined list of available healthcheck modes is also
removed to allow passing any mode that will be supported
in future by healthcheck script.

Change-Id: I2dc681da079f75449f9f2456249d51b3c859f434
Issue-ID: OOM-1806
Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
helm_deployment_status.py

index 8f9a931..8917e99 100755 (executable)
@@ -25,7 +25,7 @@ import sys
 import argparse
 import yaml
 import requests
-from subprocess import Popen,STDOUT,PIPE
+from subprocess import Popen,STDOUT,PIPE,check_output
 import datetime
 from time import sleep
 from os.path import expanduser
@@ -137,7 +137,7 @@ def check_in_loop(k8s, max_time, sleep_time, verbosity):
     return ready
 
 def check_helm_releases():
-    helm = subprocess.check_output(['helm', 'ls'])
+    helm = check_output(['helm', 'ls'])
     if helm == '':
         sys.exit('No Helm releases detected.')
     helm_releases = csv.DictReader(
@@ -180,9 +180,7 @@ def parse_args():
             default=expanduser('~') + '/.kube/config',
             help='path to .kube/config file')
     parser.add_argument('--health-path', '-hp', help='path to ONAP robot ete-k8s.sh')
-    parser.add_argument('--health-mode', default='health', help='healthcheck mode',
-            choices=('health','healthdist','distribute','instantiate','instantiateVFWCL',
-                     'instantiateDemoVFWCL','portal'))
+    parser.add_argument('--health-mode', '-hm', default='health', help='healthcheck mode')
     parser.add_argument('--no-helm', action='store_true', help='Do not check Helm')
     parser.add_argument('--check-frequency', '-w', default=300, type=int,
             help='time between readiness checks in seconds')