mixins.py 527 B

123456789101112131415
  1. # pylint: disable=missing-docstring,too-few-public-methods
  2. """
  3. Mixin classes meant to be used with subclasses of OpenShiftCheck.
  4. """
  5. from openshift_checks import get_var
  6. class NotContainerizedMixin(object):
  7. """Mixin for checks that are only active when not in containerized mode."""
  8. @classmethod
  9. def is_active(cls, task_vars):
  10. is_containerized = get_var(task_vars, "openshift", "common", "is_containerized")
  11. return super(NotContainerizedMixin, cls).is_active(task_vars) and not is_containerized