summaryrefslogtreecommitdiffstats
path: root/ipaplatform/fedora/services.py
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2014-06-09 13:45:48 +0200
committerPetr Viktorin <pviktori@redhat.com>2014-06-16 19:48:21 +0200
commit3b4ab8b4f224db67613544923a608c51ad476748 (patch)
tree90abd1db31e6f76bdac204242b09e7163f146d71 /ipaplatform/fedora/services.py
parent8a5e2a816667587bf767990dc2715d6996975d44 (diff)
downloadfreeipa-3b4ab8b4f224db67613544923a608c51ad476748.tar.gz
freeipa-3b4ab8b4f224db67613544923a608c51ad476748.tar.xz
freeipa-3b4ab8b4f224db67613544923a608c51ad476748.zip
ipaplatform: Move hardcoded paths from Fedora platform files to path namespace
Part of: https://fedorahosted.org/freeipa/ticket/4052 Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Diffstat (limited to 'ipaplatform/fedora/services.py')
-rw-r--r--ipaplatform/fedora/services.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/ipaplatform/fedora/services.py b/ipaplatform/fedora/services.py
index 788f62a16..d98c2d6d7 100644
--- a/ipaplatform/fedora/services.py
+++ b/ipaplatform/fedora/services.py
@@ -31,6 +31,7 @@ from ipaplatform.base import services as base_services
from ipapython import ipautil, dogtag
from ipapython.ipa_log_manager import root_logger
from ipalib import api
+from ipaplatform.paths import paths
# Mappings from service names as FreeIPA code references to these services
# to their actual systemd service names
@@ -97,9 +98,7 @@ class FedoraDirectoryService(FedoraService):
Returns False if the setting of the nofile limit needs to be skipped.
"""
- dirsrv_systemd = "/etc/sysconfig/dirsrv.systemd"
-
- if os.path.exists(dirsrv_systemd):
+ if os.path.exists(paths.SYSCONFIG_DIRSRV_SYSTEMD):
# We need to enable LimitNOFILE=8192 in the dirsrv@.service
# Since 389-ds-base-1.2.10-0.8.a7 the configuration of the
# service parameters is performed via
@@ -107,10 +106,10 @@ class FedoraDirectoryService(FedoraService):
# into dirsrv@.service unit
replacevars = {'LimitNOFILE': str(num)}
- ipautil.inifile_replace_variables(dirsrv_systemd,
+ ipautil.inifile_replace_variables(paths.SYSCONFIG_DIRSRV_SYSTEMD,
'service',
replacevars=replacevars)
- tasks.restore_context(dirsrv_systemd)
+ tasks.restore_context(paths.SYSCONFIG_DIRSRV_SYSTEMD)
ipautil.run(["/bin/systemctl", "--system", "daemon-reload"],
raiseonerr=False)
@@ -129,9 +128,9 @@ class FedoraDirectoryService(FedoraService):
if instance_name:
elements = self.systemd_name.split("@")
- srv_etc = os.path.join(self.SYSTEMD_ETC_PATH,
+ srv_etc = os.path.join(paths.ETC_SYSTEMD_SYSTEM_DIR,
self.systemd_name)
- srv_tgt = os.path.join(self.SYSTEMD_ETC_PATH,
+ srv_tgt = os.path.join(paths.ETC_SYSTEMD_SYSTEM_DIR,
self.SYSTEMD_SRV_TARGET % (elements[0]))
srv_lnk = os.path.join(srv_tgt,
self.service_instance(instance_name))
@@ -169,7 +168,7 @@ class FedoraCAService(FedoraService):
# TODO: Use a cleaner solution
use_proxy = True
if not (os.path.exists('/etc/httpd/conf.d/ipa.conf') and
- os.path.exists('/etc/httpd/conf.d/ipa-pki-proxy.conf')):
+ os.path.exists(paths.HTTPD_IPA_PKI_PROXY_CONF)):
root_logger.debug(
'The httpd proxy is not installed, wait on local port')
use_proxy = False