mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-13 09:41:55 -06:00
fe6f2b6f6e
Commit 1e6a204b43
added explicit confdir
setting to api.bootstrap() calls of a randomly selected portion of
server-side scripts and tests. This commit adds it to the rest of
server-side code for consistency.
https://fedorahosted.org/freeipa/ticket/6389
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
29 lines
1.1 KiB
Plaintext
29 lines
1.1 KiB
Plaintext
from ipaplatform.paths import paths
|
|
from ipalib import api
|
|
from ipalib.config import Env
|
|
from ipalib.constants import DEFAULT_CONFIG
|
|
|
|
# Determine what debug level is configured. We can only do this
|
|
# by reading in the configuration file(s). The server always reads
|
|
# default.conf and will also read in `context'.conf.
|
|
env = Env()
|
|
env._bootstrap(context='server', log=None, confdir=paths.ETC_IPA)
|
|
env._finalize_core(**dict(DEFAULT_CONFIG))
|
|
|
|
# Initialize the API with the proper debug level
|
|
api.bootstrap(context='server', confdir=paths.ETC_IPA,
|
|
debug=env.debug, log=None) (ref:wsgi-app-bootstrap)
|
|
try:
|
|
api.finalize() (ref:wsgi-app-finalize)
|
|
except Exception as e:
|
|
api.log.error('Failed to start IPA: %s' % e)
|
|
else:
|
|
api.log.info('*** PROCESS START ***')
|
|
|
|
# This is the WSGI callable:
|
|
def application(environ, start_response): (ref:wsgi-app-start)
|
|
if not environ['wsgi.multithread']:
|
|
return api.Backend.session(environ, start_response)
|
|
else:
|
|
api.log.error("IPA does not work with the threaded MPM, use the pre-fork MPM") (ref:wsgi-app-end)
|