mixins.py 604 B

123456789101112131415161718
  1. # pylint: disable=missing-docstring
  2. from openshift_checks import get_var
  3. class NotContainerizedMixin(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 OpenShiftCheck.
  9. super(NotContainerizedMixin, cls).is_active(task_vars) and
  10. not cls.is_containerized(task_vars)
  11. )
  12. @staticmethod
  13. def is_containerized(task_vars):
  14. return get_var(task_vars, "openshift", "common", "is_containerized")