makeaci, makeapi, oddjob: use the default API context

Use the default context rather the server context for code not running
inside the server.

This prevents the affected code 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:20:23 +02:00
parent 7d9afd988a
commit 2615103c68
3 changed files with 2 additions and 4 deletions

View File

@ -72,11 +72,11 @@ if len(args) != 1:
trusted_domain = ipautil.fsdecode(args[0]).lower()
env = Env()
env._bootstrap(context='server', debug=options.debug, log=None)
env._bootstrap(debug=options.debug, log=None)
env._finalize_core(**dict(DEFAULT_CONFIG))
# Initialize the API with the proper debug level
api.bootstrap(context='server', debug=env.debug, log=None)
api.bootstrap(debug=env.debug, log=None)
api.finalize()
# Only import trust plugin after api is initialized or internal imports

View File

@ -86,7 +86,6 @@ def check_member_attrs(name, template):
def main(options):
api.bootstrap(
context='server',
in_server=True,
in_tree=True,
debug=False,

View File

@ -501,7 +501,6 @@ def main():
options, args = parse_options()
cfg = dict(
context='server',
in_server=True,
in_tree=True,
debug=False,