summaryrefslogtreecommitdiffstats
path: root/roles/openshift_health_checker/action_plugins
diff options
context:
space:
mode:
authorRodolfo Carvalho <rhcarvalho@gmail.com>2017-06-09 17:04:19 +0200
committerRodolfo Carvalho <rhcarvalho@gmail.com>2017-06-23 15:34:42 +0200
commit11040f1b76981c22d62d17d1d22a3741e50a27fd (patch)
tree44937ead88658e0c56c6954d9b9754cd872fd63c /roles/openshift_health_checker/action_plugins
parent0371aff5b86302d4786a87c0fe6f52b32a2952c9 (diff)
downloadopenshift-11040f1b76981c22d62d17d1d22a3741e50a27fd.tar.gz
openshift-11040f1b76981c22d62d17d1d22a3741e50a27fd.tar.bz2
openshift-11040f1b76981c22d62d17d1d22a3741e50a27fd.tar.xz
openshift-11040f1b76981c22d62d17d1d22a3741e50a27fd.zip
Capture exceptions when resolving available checks
Calling the action plugin (e.g. when running a playbook) with an incorrect check name was raising an unhandled exception, leading to poor output in Ansible (requiring a higher verbosity level to see what is going wrong).
Diffstat (limited to 'roles/openshift_health_checker/action_plugins')
-rw-r--r--roles/openshift_health_checker/action_plugins/openshift_health_check.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/roles/openshift_health_checker/action_plugins/openshift_health_check.py b/roles/openshift_health_checker/action_plugins/openshift_health_check.py
index a62e4331e..0390dc82e 100644
--- a/roles/openshift_health_checker/action_plugins/openshift_health_check.py
+++ b/roles/openshift_health_checker/action_plugins/openshift_health_check.py
@@ -38,14 +38,13 @@ class ActionModule(ActionBase):
try:
known_checks = self.load_known_checks()
+ args = self._task.args
+ resolved_checks = resolve_checks(args.get("checks", []), known_checks.values())
except OpenShiftCheckException as e:
result["failed"] = True
result["msg"] = str(e)
return result
- args = self._task.args
- resolved_checks = resolve_checks(args.get("checks", []), known_checks.values())
-
result["checks"] = check_results = {}
user_disabled_checks = [