Set explicit confdir option for global contexts

Some API contexts are used to modify global state (e.g. files in /etc
and /var). These contexts do not support confdir overrides. Initialize
the API with an explicit confdir argument to paths.ETC_IPA.

The special contexts are:

* backup
* cli_installer
* installer
* ipctl
* renew
* restore
* server
* updates

The patch also corrects the context of the ipa-httpd-kdcproxy script to
'server'.

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

Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Christian Heimes authored and Jan Cholasta committed 2016-12-02 09:14:35 +01:00
1 parent 98f0077360
commit 1e6a204b43
32 files changed
+86 -42

No files matched your search

@@ -8,6 +8,7 @@ from ipapython.dn import DN
from ipalib.config import Env
from ipalib.constants import DEFAULT_CONFIG
from ipaplatform.constants import constants
from ipaplatform.paths import paths
import sys
import os
import pwd
@@ -95,7 +96,8 @@ env._bootstrap(debug=options.debug, log=None)
env._finalize_core(**dict(DEFAULT_CONFIG))
# Initialize the API with the proper debug level
api.bootstrap(in_server=True, debug=env.debug, log=None, context='server')
api.bootstrap(in_server=True, debug=env.debug, log=None,
context='server', confdir=paths.ETC_IPA)
api.finalize()
# Only import trust plugin after api is initialized or internal imports