summaryrefslogtreecommitdiffstats
path: root/roles/openshift_health_checker/openshift_checks/__init__.py
diff options
context:
space:
mode:
authorjuanvallejo <jvallejo@redhat.com>2017-03-22 15:52:35 -0400
committerjuanvallejo <jvallejo@redhat.com>2017-06-02 16:44:07 -0400
commit2e53dbb4c0d9bfe79cd79e0a0ece9db065b286df (patch)
treee2bcc99a895fc6647bc7623a8bcbf6c8fd5385f8 /roles/openshift_health_checker/openshift_checks/__init__.py
parent46dca9b8b15ed67adfa2ca617f300e5d1df7c3e0 (diff)
downloadopenshift-2e53dbb4c0d9bfe79cd79e0a0ece9db065b286df.tar.gz
openshift-2e53dbb4c0d9bfe79cd79e0a0ece9db065b286df.tar.bz2
openshift-2e53dbb4c0d9bfe79cd79e0a0ece9db065b286df.tar.xz
openshift-2e53dbb4c0d9bfe79cd79e0a0ece9db065b286df.zip
add elasticseatch, fluentd, kibana check
Diffstat (limited to 'roles/openshift_health_checker/openshift_checks/__init__.py')
-rw-r--r--roles/openshift_health_checker/openshift_checks/__init__.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/__init__.py b/roles/openshift_health_checker/openshift_checks/__init__.py
index be63d864a..5c9949ced 100644
--- a/roles/openshift_health_checker/openshift_checks/__init__.py
+++ b/roles/openshift_health_checker/openshift_checks/__init__.py
@@ -66,16 +66,26 @@ class OpenShiftCheck(object):
LOADER_EXCLUDES = (
"__init__.py",
"mixins.py",
+ "logging.py",
)
-def load_checks():
+def load_checks(path=None, subpkg=""):
"""Dynamically import all check modules for the side effect of registering checks."""
- return [
- import_module(__package__ + "." + name[:-3])
- for name in os.listdir(os.path.dirname(__file__))
- if name.endswith(".py") and name not in LOADER_EXCLUDES
- ]
+ if path is None:
+ path = os.path.dirname(__file__)
+
+ modules = []
+
+ for name in os.listdir(path):
+ if os.path.isdir(os.path.join(path, name)):
+ modules = modules + load_checks(os.path.join(path, name), subpkg + "." + name)
+ continue
+
+ if name.endswith(".py") and name not in LOADER_EXCLUDES:
+ modules.append(import_module(__package__ + subpkg + "." + name[:-3]))
+
+ return modules
def get_var(task_vars, *keys, **kwargs):