xmlserver: initialize RPC server plugins only in server context

Do not initialize the plugins for all in-server API instances, as they are
used only in the server context.

This prevents code using in-server API instances from attempting to
initialize the session manager.

https://fedorahosted.org/freeipa/ticket/5988

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
This commit is contained in:
Jan Cholasta 2016-06-29 16:05:07 +02:00
parent a901ec1ce9
commit 7d9afd988a

View File

@ -27,7 +27,7 @@ from ipalib import Registry, api
register = Registry()
if 'in_server' in api.env and api.env.in_server is True:
if api.env.context in ('server', 'lite'):
from ipaserver.rpcserver import wsgi_dispatch, xmlserver, jsonserver_kerb, jsonserver_session, login_kerberos, login_password, change_password, sync_token, xmlserver_session
register()(wsgi_dispatch)
register()(xmlserver)