Add scope_types attribute to the BaseCheck class

Neutron, based on the defined policy rules is creating check
objects "in flight" to e.g. include check some object's attributes,
like e.g. network's provider parameters.
That use case requires that BaseCheck class and classes which inherits
from it needs to have scope_types defined thus Neutron can set it for
the Check based on the defined policy rule.

This patch adds scope_types attribute to the BaseCheck class to make it
available for use cases like described above.

Related-Bug: #1923503
Change-Id: Ibf30d0ffa5e9b125742089705d3557c02a03bc43
This commit is contained in:
Slawek Kaplonski
2021-10-05 11:09:31 +02:00
parent 4f0e206a12
commit fb51982f80

View File

@@ -83,6 +83,8 @@ def _check(rule, target, creds, enforcer, current_rule):
class BaseCheck(metaclass=abc.ABCMeta):
"""Abstract base class for Check classes."""
scope_types = None
@abc.abstractmethod
def __str__(self):
"""String representation of the Check tree rooted at this node."""