Browse Source

Make LoggingCheck.run return the correct type

The run method is expected to return a dict. Even though we should not
run LoggingCheck by itself, it is still possible to do it and without
this change we get an unhandled exception.
Rodolfo Carvalho 7 years ago
parent
commit
85bb52d586

+ 4 - 1
roles/openshift_health_checker/openshift_checks/logging/logging.py

@@ -11,6 +11,9 @@ from openshift_checks import OpenShiftCheck, OpenShiftCheckException
 class LoggingCheck(OpenShiftCheck):
     """Base class for OpenShift aggregated logging component checks"""
 
+    # FIXME: this should not be listed as a check, since it is not meant to be
+    # run by itself.
+
     name = "logging"
     logging_namespace = "logging"
 
@@ -27,7 +30,7 @@ class LoggingCheck(OpenShiftCheck):
         return masters[0] == hostname
 
     def run(self):
-        pass
+        return {}
 
     def get_pods_for_component(self, namespace, logging_component):
         """Get all pods for a given component. Returns: list of pods for component, error string"""