summaryrefslogtreecommitdiffstats
path: root/roles/openshift_health_checker/library
diff options
context:
space:
mode:
authorLuke Meyer <lmeyer@redhat.com>2017-09-20 21:35:57 -0400
committerLuke Meyer <lmeyer@redhat.com>2017-09-21 13:43:47 -0400
commit9698f76b641b7cc5964d2f4f318ea71702aa2245 (patch)
tree04f9ec59ae00ce8b79c82dd0526051ed6a0a3192 /roles/openshift_health_checker/library
parent4f5839e585a78243eae2d215176047299c52a1eb (diff)
downloadopenshift-9698f76b641b7cc5964d2f4f318ea71702aa2245.tar.gz
openshift-9698f76b641b7cc5964d2f4f318ea71702aa2245.tar.bz2
openshift-9698f76b641b7cc5964d2f4f318ea71702aa2245.tar.xz
openshift-9698f76b641b7cc5964d2f4f318ea71702aa2245.zip
health checks: add diagnostics check
Also, moved is_first_master method into superclass for reuse. And look at oo_first_master and ansible_host instead of masters and ansible_ssh_host.
Diffstat (limited to 'roles/openshift_health_checker/library')
-rw-r--r--roles/openshift_health_checker/library/ocutil.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/roles/openshift_health_checker/library/ocutil.py b/roles/openshift_health_checker/library/ocutil.py
index 2e60735d6..c72f4c5b3 100644
--- a/roles/openshift_health_checker/library/ocutil.py
+++ b/roles/openshift_health_checker/library/ocutil.py
@@ -40,18 +40,17 @@ def main():
module = AnsibleModule(
argument_spec=dict(
- namespace=dict(type="str", required=True),
+ namespace=dict(type="str", required=False),
config_file=dict(type="str", required=True),
cmd=dict(type="str", required=True),
extra_args=dict(type="list", default=[]),
),
)
- cmd = [
- locate_oc_binary(),
- '--config', module.params["config_file"],
- '-n', module.params["namespace"],
- ] + shlex.split(module.params["cmd"])
+ cmd = [locate_oc_binary(), '--config', module.params["config_file"]]
+ if module.params["namespace"]:
+ cmd += ['-n', module.params["namespace"]]
+ cmd += shlex.split(module.params["cmd"]) + module.params["extra_args"]
failed = True
try: