summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2016-11-02 06:30:38 +0100
committerJan Cholasta <jcholast@redhat.com>2016-11-11 12:17:25 +0100
commit08a446a6bc516936497c1e0f278a699148f6330c (patch)
treea4577ee3a3c1cda187e9a57fab6c47758243fcef /ipapython
parent269ca6c4547fc017bb3a88e994ca770047122b3e (diff)
downloadfreeipa-08a446a6bc516936497c1e0f278a699148f6330c.tar.gz
freeipa-08a446a6bc516936497c1e0f278a699148f6330c.tar.xz
freeipa-08a446a6bc516936497c1e0f278a699148f6330c.zip
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>
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/install/core.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/ipapython/install/core.py b/ipapython/install/core.py
index bfec397b5..f0b75e3a2 100644
--- a/ipapython/install/core.py
+++ b/ipapython/install/core.py
@@ -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