diff options
author | Rodolfo Carvalho <rhcarvalho@gmail.com> | 2017-08-08 18:53:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-08 18:53:44 +0200 |
commit | 7121e065b54f9642e6f69ca768b57c3eec542bf7 (patch) | |
tree | 4f849a9a7625cf97ad886c4513606121a0b20497 /roles/openshift_health_checker/openshift_checks/logging/fluentd_config.py | |
parent | 0569c5069dabeea9e2fe94cd097cb6f2b1540867 (diff) | |
parent | 06a6fb9642a2cc70b1ca65f403b853fe8ce9d4b2 (diff) | |
download | openshift-7121e065b54f9642e6f69ca768b57c3eec542bf7.tar.gz openshift-7121e065b54f9642e6f69ca768b57c3eec542bf7.tar.bz2 openshift-7121e065b54f9642e6f69ca768b57c3eec542bf7.tar.xz openshift-7121e065b54f9642e6f69ca768b57c3eec542bf7.zip |
Merge pull request #4913 from sosiouxme/20170720-refactor-check-results
openshift_checks: refactor check results
Diffstat (limited to 'roles/openshift_health_checker/openshift_checks/logging/fluentd_config.py')
-rw-r--r-- | roles/openshift_health_checker/openshift_checks/logging/fluentd_config.py | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/logging/fluentd_config.py b/roles/openshift_health_checker/openshift_checks/logging/fluentd_config.py index 0970f0a63..d783e6760 100644 --- a/roles/openshift_health_checker/openshift_checks/logging/fluentd_config.py +++ b/roles/openshift_health_checker/openshift_checks/logging/fluentd_config.py @@ -24,7 +24,6 @@ class FluentdConfig(LoggingCheck): def run(self): """Check that Fluentd has running pods, and that its logging config matches Docker's logging config.""" - self.logging_namespace = self.get_var("openshift_logging_namespace", default=self.logging_namespace) config_error = self.check_logging_config() if config_error: msg = ("The following Fluentd logging configuration problem was found:" @@ -120,19 +119,13 @@ class FluentdConfig(LoggingCheck): def running_fluentd_pods(self): """Return a list of running fluentd pods.""" - fluentd_pods, error = self.get_pods_for_component( - self.logging_namespace, - "fluentd", - ) - if error: - msg = 'Unable to retrieve any pods for the "fluentd" logging component: {}'.format(error) - raise OpenShiftCheckException(msg) + fluentd_pods = self.get_pods_for_component("fluentd") running_fluentd_pods = [pod for pod in fluentd_pods if pod['status']['phase'] == 'Running'] if not running_fluentd_pods: - msg = ('No Fluentd pods were found to be in the "Running" state. ' - 'At least one Fluentd pod is required in order to perform this check.') - - raise OpenShiftCheckException(msg) + raise OpenShiftCheckException( + 'No Fluentd pods were found to be in the "Running" state. ' + 'At least one Fluentd pod is required in order to perform this check.' + ) return running_fluentd_pods |