Browse Source

Simplify mixin class

- Expose only is_active and no other method.
- Move general comment to module docstring.
Rodolfo Carvalho 8 years ago
parent
commit
59e781baaa
1 changed files with 7 additions and 10 deletions
  1. 7 10
      roles/openshift_health_checker/openshift_checks/mixins.py

+ 7 - 10
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