diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2017-09-22 21:02:35 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-22 21:02:35 -0700 |
commit | e1650a2e1da3b1a365a8e4f021d1c55fe4ffc72d (patch) | |
tree | a286bae582ca912e1b7badd1052f5d2ad52ec91e /roles/openshift_health_checker/library/ocutil.py | |
parent | d407d4fc3cb1d76d7fef52088e2459a420952c16 (diff) | |
parent | 9698f76b641b7cc5964d2f4f318ea71702aa2245 (diff) | |
download | openshift-e1650a2e1da3b1a365a8e4f021d1c55fe4ffc72d.tar.gz openshift-e1650a2e1da3b1a365a8e4f021d1c55fe4ffc72d.tar.bz2 openshift-e1650a2e1da3b1a365a8e4f021d1c55fe4ffc72d.tar.xz openshift-e1650a2e1da3b1a365a8e4f021d1c55fe4ffc72d.zip |
Merge pull request #5491 from sosiouxme/20170920-diagnostics-check
Automatic merge from submit-queue
health checks: add diagnostics check
Adds a health check that runs `oc adm diagnostics` with each individual diagnostic.
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/ocutil.py')
-rw-r--r-- | roles/openshift_health_checker/library/ocutil.py | 11 |
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: |