From e149ad8185fdba2eb87282d05f4a24f3e4dd4f26 Mon Sep 17 00:00:00 2001 From: Rodolfo Carvalho Date: Thu, 11 May 2017 12:19:49 +0200 Subject: Add module docstring --- roles/openshift_health_checker/openshift_checks/etcd_volume.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'roles') diff --git a/roles/openshift_health_checker/openshift_checks/etcd_volume.py b/roles/openshift_health_checker/openshift_checks/etcd_volume.py index ad88ae44d..b52a9259f 100644 --- a/roles/openshift_health_checker/openshift_checks/etcd_volume.py +++ b/roles/openshift_health_checker/openshift_checks/etcd_volume.py @@ -1,3 +1,5 @@ +"""A health check for OpenShift clusters.""" + from openshift_checks import OpenShiftCheck, OpenShiftCheckException, get_var -- cgit v1.2.3 From f4e1e89f88c6885a6f0be0e7b3eca296d646502b Mon Sep 17 00:00:00 2001 From: Rodolfo Carvalho Date: Thu, 11 May 2017 12:23:40 +0200 Subject: Make class attribute name shorter --- roles/openshift_health_checker/openshift_checks/etcd_volume.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'roles') diff --git a/roles/openshift_health_checker/openshift_checks/etcd_volume.py b/roles/openshift_health_checker/openshift_checks/etcd_volume.py index b52a9259f..df35ecb33 100644 --- a/roles/openshift_health_checker/openshift_checks/etcd_volume.py +++ b/roles/openshift_health_checker/openshift_checks/etcd_volume.py @@ -9,9 +9,9 @@ class EtcdVolume(OpenShiftCheck): name = "etcd_volume" tags = ["etcd", "health"] - # pylint: disable=invalid-name - default_etcd_device_usage_threshold_percent = 90 - # where to find ectd data, higher priority first. + # Default device usage threshold. Value should be in the range [0, 100]. + default_threshold_percent = 90 + # Where to find ectd data, higher priority first. supported_mount_paths = ["/var/lib/etcd", "/var/lib", "/var", "/"] @classmethod @@ -29,7 +29,7 @@ class EtcdVolume(OpenShiftCheck): threshold = get_var( task_vars, "etcd_device_usage_threshold_percent", - default=self.default_etcd_device_usage_threshold_percent + default=self.default_threshold_percent ) used_percent = 100.0 * used / total -- cgit v1.2.3 From 92c1ef8d62fe4daf96319408f763f1bf33c7916a Mon Sep 17 00:00:00 2001 From: Rodolfo Carvalho Date: Thu, 11 May 2017 12:26:57 +0200 Subject: Update variable name to standard It was agreed to name role variables as `r_ROLE_NAME_VARIABLE_NAME`. Giving it a try. --- roles/openshift_health_checker/openshift_checks/etcd_volume.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'roles') diff --git a/roles/openshift_health_checker/openshift_checks/etcd_volume.py b/roles/openshift_health_checker/openshift_checks/etcd_volume.py index df35ecb33..9e58177a5 100644 --- a/roles/openshift_health_checker/openshift_checks/etcd_volume.py +++ b/roles/openshift_health_checker/openshift_checks/etcd_volume.py @@ -28,7 +28,7 @@ class EtcdVolume(OpenShiftCheck): threshold = get_var( task_vars, - "etcd_device_usage_threshold_percent", + "r_openshift_health_checker_etcd_device_usage_threshold_percent", default=self.default_threshold_percent ) -- cgit v1.2.3