mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipalib, ipaserver: migrate all plugins to Registry-based registration
Do not use the deprecated API.register method. https://fedorahosted.org/freeipa/ticket/4739 Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
@@ -1269,7 +1269,7 @@ def select_any_master(ldap2, service='CA'):
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
from ipalib import api, errors, SkipPluginModule
|
||||
from ipalib import Registry, api, errors, SkipPluginModule
|
||||
if api.env.ra_plugin != 'dogtag':
|
||||
# In this case, abort loading this plugin module...
|
||||
raise SkipPluginModule(reason='dogtag not selected as RA plugin')
|
||||
@@ -1281,7 +1281,10 @@ from ipalib.util import cachedproperty
|
||||
from ipalib import _
|
||||
from ipaplatform.paths import paths
|
||||
|
||||
register = Registry()
|
||||
|
||||
|
||||
@register()
|
||||
class ra(rabase.rabase):
|
||||
"""
|
||||
Request Authority backend plugin.
|
||||
@@ -1895,10 +1898,8 @@ class ra(rabase.rabase):
|
||||
return results
|
||||
|
||||
|
||||
api.register(ra)
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
@register()
|
||||
class kra(Backend):
|
||||
"""
|
||||
KRA backend plugin (for Vault)
|
||||
@@ -1957,8 +1958,6 @@ class kra(Backend):
|
||||
|
||||
return KRAClient(connection, crypto)
|
||||
|
||||
api.register(kra)
|
||||
|
||||
|
||||
class RestClient(Backend):
|
||||
"""Simple Dogtag REST client to be subclassed by other backends.
|
||||
@@ -2091,6 +2090,7 @@ class RestClient(Backend):
|
||||
return (status, resp_headers, resp_body)
|
||||
|
||||
|
||||
@register()
|
||||
class ra_certprofile(RestClient):
|
||||
"""
|
||||
Profile management backend plugin.
|
||||
@@ -2146,5 +2146,3 @@ class ra_certprofile(RestClient):
|
||||
Delete the profile from Dogtag
|
||||
"""
|
||||
self._ssldo('DELETE', profile_id, headers={'Accept': 'application/json'})
|
||||
|
||||
api.register(ra_certprofile)
|
||||
|
||||
@@ -23,7 +23,7 @@ Joining an IPA domain
|
||||
|
||||
import six
|
||||
|
||||
from ipalib import api
|
||||
from ipalib import Registry, api
|
||||
from ipalib import Command, Str
|
||||
from ipalib import errors
|
||||
from ipalib import _
|
||||
@@ -32,6 +32,8 @@ from ipaserver.install import installutils
|
||||
if six.PY3:
|
||||
unicode = str
|
||||
|
||||
register = Registry()
|
||||
|
||||
|
||||
def validate_host(ugettext, cn):
|
||||
"""
|
||||
@@ -43,6 +45,7 @@ def validate_host(ugettext, cn):
|
||||
return None
|
||||
|
||||
|
||||
@register()
|
||||
class join(Command):
|
||||
"""Join an IPA domain"""
|
||||
|
||||
@@ -127,5 +130,3 @@ class join(Command):
|
||||
config['ipacertificatesubjectbase']
|
||||
|
||||
return (dn, attrs_list)
|
||||
|
||||
api.register(join)
|
||||
|
||||
@@ -52,11 +52,14 @@ except ImportError:
|
||||
def __init__(self, criticality, authzId=None):
|
||||
LDAPControl.__init__(self, '1.3.6.1.4.1.42.2.27.9.5.2', criticality, authzId)
|
||||
|
||||
from ipalib import api, errors, _
|
||||
from ipalib import Registry, errors, _
|
||||
from ipalib.crud import CrudBackend
|
||||
from ipalib.request import context
|
||||
|
||||
register = Registry()
|
||||
|
||||
|
||||
@register()
|
||||
class ldap2(CrudBackend, LDAPClient):
|
||||
"""
|
||||
LDAP Backend Take 2.
|
||||
@@ -578,5 +581,3 @@ class ldap2(CrudBackend, LDAPClient):
|
||||
if truncated:
|
||||
return (-1, output)
|
||||
return (len(output), output)
|
||||
|
||||
api.register(ldap2)
|
||||
|
||||
@@ -22,16 +22,19 @@
|
||||
Loads WSGI server plugins.
|
||||
"""
|
||||
|
||||
from ipalib import api
|
||||
from ipalib import Registry, api
|
||||
|
||||
register = Registry()
|
||||
|
||||
|
||||
if 'in_server' in api.env and api.env.in_server is True:
|
||||
from ipaserver.rpcserver import wsgi_dispatch, xmlserver, jsonserver_kerb, jsonserver_session, login_kerberos, login_password, change_password, sync_token, xmlserver_session
|
||||
api.register(wsgi_dispatch)
|
||||
api.register(xmlserver)
|
||||
api.register(jsonserver_kerb)
|
||||
api.register(jsonserver_session)
|
||||
api.register(login_kerberos)
|
||||
api.register(login_password)
|
||||
api.register(change_password)
|
||||
api.register(sync_token)
|
||||
api.register(xmlserver_session)
|
||||
register()(wsgi_dispatch)
|
||||
register()(xmlserver)
|
||||
register()(jsonserver_kerb)
|
||||
register()(jsonserver_session)
|
||||
register()(login_kerberos)
|
||||
register()(login_password)
|
||||
register()(change_password)
|
||||
register()(sync_token)
|
||||
register()(xmlserver_session)
|
||||
|
||||
Reference in New Issue
Block a user