mixins.py 759 B

123456789101112131415161718192021
  1. # pylint: disable=missing-docstring
  2. from openshift_checks import get_var
  3. class NotContainerized(object):
  4. """Mixin for checks that are only active when not in containerized mode."""
  5. @classmethod
  6. def is_active(cls, task_vars):
  7. return (
  8. # This mixin is meant to be used with subclasses of
  9. # OpenShiftCheck. Pylint disables this by default on mixins,
  10. # though it relies on the class name ending in 'mixin'.
  11. # pylint: disable=no-member
  12. super(NotContainerized, cls).is_active(task_vars) and
  13. not cls.is_containerized(task_vars)
  14. )
  15. @staticmethod
  16. def is_containerized(task_vars):
  17. return get_var(task_vars, "openshift", "common", "is_containerized")