summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorRodolfo Carvalho <rhcarvalho@gmail.com>2017-04-11 14:31:09 +0200
committerjuanvallejo <jvallejo@redhat.com>2017-04-17 13:29:24 -0400
commit59e781baaa33d1ffb0d57529c23fd9a1c01a377a (patch)
tree6d238764a4e6bcd9c9fecb346e30d1a4542ce45c /roles
parentc74543f55b14b8153298baa0115f8ab05d2c6961 (diff)
downloadopenshift-59e781baaa33d1ffb0d57529c23fd9a1c01a377a.tar.gz
openshift-59e781baaa33d1ffb0d57529c23fd9a1c01a377a.tar.bz2
openshift-59e781baaa33d1ffb0d57529c23fd9a1c01a377a.tar.xz
openshift-59e781baaa33d1ffb0d57529c23fd9a1c01a377a.zip
Simplify mixin class
- Expose only is_active and no other method. - Move general comment to module docstring.
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_health_checker/openshift_checks/mixins.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/roles/openshift_health_checker/openshift_checks/mixins.py b/roles/openshift_health_checker/openshift_checks/mixins.py
index 657e15160..20d160eaf 100644
--- a/roles/openshift_health_checker/openshift_checks/mixins.py
+++ b/roles/openshift_health_checker/openshift_checks/mixins.py
@@ -1,4 +1,8 @@
-# pylint: disable=missing-docstring
+# pylint: disable=missing-docstring,too-few-public-methods
+"""
+Mixin classes meant to be used with subclasses of OpenShiftCheck.
+"""
+
from openshift_checks import get_var
@@ -7,12 +11,5 @@ class NotContainerizedMixin(object):
@classmethod
def is_active(cls, task_vars):
- return (
- # This mixin is meant to be used with subclasses of OpenShiftCheck.
- super(NotContainerizedMixin, cls).is_active(task_vars) and
- not cls.is_containerized(task_vars)
- )
-
- @staticmethod
- def is_containerized(task_vars):
- return get_var(task_vars, "openshift", "common", "is_containerized")
+ is_containerized = get_var(task_vars, "openshift", "common", "is_containerized")
+ return super(NotContainerizedMixin, cls).is_active(task_vars) and not is_containerized