mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
install: fix subclassing of knob groups
Add new @group decorator to declare an installer class as a knob group instead of subclassing Group, so that subclassing the installer does not create duplicates of the original group. https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
@@ -23,7 +23,7 @@ from . import util, typing
|
||||
from .util import from_
|
||||
|
||||
__all__ = ['InvalidStateError', 'KnobValueError', 'Property', 'Knob',
|
||||
'Configurable', 'Group', 'Component', 'Composite']
|
||||
'Configurable', 'group', 'Component', 'Composite']
|
||||
|
||||
NoneType = type(None)
|
||||
|
||||
@@ -516,11 +516,14 @@ class Configurable(six.with_metaclass(abc.ABCMeta, object)):
|
||||
self.__state = to_state
|
||||
|
||||
|
||||
class Group(Configurable):
|
||||
@classmethod
|
||||
def group(cls):
|
||||
def group(cls):
|
||||
def group():
|
||||
return cls
|
||||
|
||||
cls.group = staticmethod(group)
|
||||
|
||||
return cls
|
||||
|
||||
|
||||
class ComponentMeta(util.InnerClassMeta, abc.ABCMeta):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user