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
|
||||
|
||||
@@ -12,7 +12,7 @@ import six
|
||||
from ipapython.dn import DN
|
||||
from ipapython.ipautil import CheckedIPAddress
|
||||
from ipapython.install import common, core
|
||||
from ipapython.install.core import Knob
|
||||
from ipapython.install.core import Knob, group
|
||||
from ipalib.util import validate_domain_name
|
||||
from ipaserver.install import bindinstance
|
||||
from ipapython.dnsutil import check_zone_overlap
|
||||
@@ -29,7 +29,8 @@ VALID_SUBJECT_ATTRS = ['st', 'o', 'ou', 'dnqualifier', 'c',
|
||||
'incorporationcountry', 'businesscategory']
|
||||
|
||||
|
||||
class BaseServerCA(common.Installable, core.Group, core.Composite):
|
||||
@group
|
||||
class BaseServerCA(common.Installable, core.Composite):
|
||||
description = "certificate system"
|
||||
|
||||
external_ca = Knob(
|
||||
@@ -160,7 +161,8 @@ class BaseServerCA(common.Installable, core.Group, core.Composite):
|
||||
)
|
||||
|
||||
|
||||
class BaseServerDNS(common.Installable, core.Group, core.Composite):
|
||||
@group
|
||||
class BaseServerDNS(common.Installable, core.Composite):
|
||||
description = "DNS"
|
||||
|
||||
forwarders = Knob(
|
||||
|
||||
@@ -1138,10 +1138,6 @@ def uninstall(installer):
|
||||
|
||||
|
||||
class ServerCA(BaseServerCA):
|
||||
|
||||
# FIXME: Following Knobs are inherited because framework is not able to
|
||||
# help groups correctly.
|
||||
|
||||
external_ca = Knob(BaseServerCA.external_ca)
|
||||
external_ca_type = Knob(BaseServerCA.external_ca_type)
|
||||
external_cert_files = Knob(BaseServerCA.external_cert_files)
|
||||
@@ -1176,12 +1172,6 @@ class ServerCA(BaseServerCA):
|
||||
cli_aliases=['pkinit_pin'],
|
||||
)
|
||||
|
||||
dirsrv_cert_name = Knob(BaseServerCA.dirsrv_cert_name)
|
||||
http_cert_name = Knob(BaseServerCA.http_cert_name)
|
||||
pkinit_cert_name = Knob(BaseServerCA.pkinit_cert_name)
|
||||
ca_cert_files = Knob(BaseServerCA.ca_cert_files)
|
||||
subject = Knob(BaseServerCA.subject)
|
||||
ca_signing_algorithm = Knob(BaseServerCA.ca_signing_algorithm)
|
||||
skip_schema_check = None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user