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

+1 -1
View File
@@ -40,7 +40,7 @@ from ipaplatform.paths import paths
def _main():
nickname = sys.argv[1]
api.bootstrap(in_server=True, context='restart')
api.bootstrap(in_server=True, context='restart', confdir=paths.ETC_IPA)
api.finalize()
api.Backend.ldap2.connect()
+1 -1
View File
@@ -36,7 +36,7 @@ from ipaplatform.paths import paths
def _main():
nickname = 'ipaCert'
api.bootstrap(in_server=True, context='restart')
api.bootstrap(in_server=True, context='restart', confdir=paths.ETC_IPA)
api.finalize()
api.Backend.ldap2.connect()
+2 -1
View File
@@ -24,6 +24,7 @@ import syslog
import traceback
from ipalib import api
from ipaplatform import services
from ipaplatform.paths import paths
from ipaserver.install import certs
@@ -33,7 +34,7 @@ def _main():
except IndexError:
instance = ""
api.bootstrap(in_server=True, context='restart')
api.bootstrap(in_server=True, context='restart', confdir=paths.ETC_IPA)
api.finalize()
syslog.syslog(syslog.LOG_NOTICE, "certmonger restarted dirsrv instance '%s'" % instance)
+2 -1
View File
@@ -23,11 +23,12 @@ import syslog
import traceback
from ipalib import api
from ipaplatform import services
from ipaplatform.paths import paths
from ipaserver.install import certs
def main():
api.bootstrap(in_server=True, context='restart')
api.bootstrap(in_server=True, context='restart', confdir=paths.ETC_IPA)
api.finalize()
dogtag_service = services.knownservices['pki_tomcatd']