summaryrefslogtreecommitdiffstats
path: root/ipaserver/install
diff options
context:
space:
mode:
Diffstat (limited to 'ipaserver/install')
-rw-r--r--ipaserver/install/bindinstance.py2
-rw-r--r--ipaserver/install/dns.py4
-rw-r--r--ipaserver/install/dnskeysyncinstance.py9
-rw-r--r--ipaserver/install/dogtaginstance.py1
-rw-r--r--ipaserver/install/httpinstance.py2
-rw-r--r--ipaserver/install/odsexporterinstance.py5
-rw-r--r--ipaserver/install/opendnssecinstance.py15
7 files changed, 20 insertions, 18 deletions
diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py
index f7d5be41e..0b451e5f5 100644
--- a/ipaserver/install/bindinstance.py
+++ b/ipaserver/install/bindinstance.py
@@ -1260,4 +1260,4 @@ class BindInstance(service.Service):
self.named_regular.start()
installutils.remove_keytab(paths.NAMED_KEYTAB)
- installutils.remove_ccache(run_as='named')
+ installutils.remove_ccache(run_as=constants.NAMED_USER)
diff --git a/ipaserver/install/dns.py b/ipaserver/install/dns.py
index 9a2fde29f..dbeacaee8 100644
--- a/ipaserver/install/dns.py
+++ b/ipaserver/install/dns.py
@@ -231,8 +231,8 @@ def install_check(standalone, api, replica, options, hostname):
dnskeysyncd.stop()
try:
ipautil.run(cmd, env=environment,
- runas=ods_enforcerd.get_user_name(),
- suplementary_groups=[named.get_group_name()])
+ runas=constants.ODS_USER,
+ suplementary_groups=[constants.NAMED_GROUP])
except CalledProcessError as e:
root_logger.debug("%s", e)
raise RuntimeError("This IPA server cannot be promoted to "
diff --git a/ipaserver/install/dnskeysyncinstance.py b/ipaserver/install/dnskeysyncinstance.py
index 4fe566cdd..4888d83f8 100644
--- a/ipaserver/install/dnskeysyncinstance.py
+++ b/ipaserver/install/dnskeysyncinstance.py
@@ -22,6 +22,7 @@ from ipapython.dn import DN
from ipapython import ipaldap
from ipapython import sysrestore, ipautil
from ipaplatform import services
+from ipaplatform.constants import constants
from ipaplatform.paths import paths
from ipalib import errors, api
from ipalib.constants import CACERT
@@ -142,14 +143,14 @@ class DNSKeySyncInstance(service.Service):
def __get_named_uid(self):
named = services.knownservices.named
try:
- return pwd.getpwnam(named.get_user_name()).pw_uid
+ return pwd.getpwnam(constants.NAMED_USER).pw_uid
except KeyError:
raise RuntimeError("Named UID not found")
def __get_named_gid(self):
named = services.knownservices.named
try:
- return grp.getgrnam(named.get_group_name()).gr_gid
+ return grp.getgrnam(constants.NAMED_GROUP).gr_gid
except KeyError:
raise RuntimeError("Named GID not found")
@@ -160,12 +161,12 @@ class DNSKeySyncInstance(service.Service):
self.named_gid = self.__get_named_gid()
try:
- self.ods_uid = pwd.getpwnam(ods_enforcerd.get_user_name()).pw_uid
+ self.ods_uid = pwd.getpwnam(constants.ODS_USER).pw_uid
except KeyError:
raise RuntimeError("OpenDNSSEC UID not found")
try:
- self.ods_gid = grp.getgrnam(ods_enforcerd.get_group_name()).gr_gid
+ self.ods_gid = grp.getgrnam(constants.ODS_GROUP).gr_gid
except KeyError:
raise RuntimeError("OpenDNSSEC GID not found")
diff --git a/ipaserver/install/dogtaginstance.py b/ipaserver/install/dogtaginstance.py
index d906d05e5..9f094d834 100644
--- a/ipaserver/install/dogtaginstance.py
+++ b/ipaserver/install/dogtaginstance.py
@@ -45,7 +45,6 @@ from ipaserver.install import replication
from ipaserver.install.installutils import stopped_service
from ipapython.ipa_log_manager import log_mgr
-PKI_USER = constants.PKI_USER
HTTPD_USER = constants.HTTPD_USER
diff --git a/ipaserver/install/httpinstance.py b/ipaserver/install/httpinstance.py
index 54aeb8ae7..b0fbe6926 100644
--- a/ipaserver/install/httpinstance.py
+++ b/ipaserver/install/httpinstance.py
@@ -54,8 +54,8 @@ SELINUX_BOOLEAN_SETTINGS = dict(
httpd_run_ipa='on',
)
-KDCPROXY_USER = 'kdcproxy'
HTTPD_USER = constants.HTTPD_USER
+KDCPROXY_USER = constants.KDCPROXY_USER
# See contrib/nsscipersuite/nssciphersuite.py
NSS_CIPHER_SUITE = [
diff --git a/ipaserver/install/odsexporterinstance.py b/ipaserver/install/odsexporterinstance.py
index e761ebcde..e9f7bf853 100644
--- a/ipaserver/install/odsexporterinstance.py
+++ b/ipaserver/install/odsexporterinstance.py
@@ -13,6 +13,7 @@ from ipaserver.install import installutils
from ipapython.ipa_log_manager import root_logger
from ipapython.dn import DN
from ipapython import sysrestore, ipautil, ipaldap
+from ipaplatform.constants import constants
from ipaplatform.paths import paths
from ipaplatform import services
from ipalib import errors, api
@@ -68,12 +69,12 @@ class ODSExporterInstance(service.Service):
ods_enforcerd = services.knownservices.ods_enforcerd
try:
- self.ods_uid = pwd.getpwnam(ods_enforcerd.get_user_name()).pw_uid
+ self.ods_uid = pwd.getpwnam(constants.ODS_USER).pw_uid
except KeyError:
raise RuntimeError("OpenDNSSEC UID not found")
try:
- self.ods_gid = grp.getgrnam(ods_enforcerd.get_group_name()).gr_gid
+ self.ods_gid = grp.getgrnam(constants.ODS_GROUP).gr_gid
except KeyError:
raise RuntimeError("OpenDNSSEC GID not found")
diff --git a/ipaserver/install/opendnssecinstance.py b/ipaserver/install/opendnssecinstance.py
index 05b2013c8..cfb41be4c 100644
--- a/ipaserver/install/opendnssecinstance.py
+++ b/ipaserver/install/opendnssecinstance.py
@@ -15,6 +15,7 @@ from ipapython.ipa_log_manager import root_logger
from ipapython.dn import DN
from ipapython import sysrestore, ipautil, ipaldap, p11helper
from ipaplatform import services
+from ipaplatform.constants import constants
from ipaplatform.paths import paths
from ipalib import errors, api
from ipaserver.install import dnskeysyncinstance
@@ -125,22 +126,22 @@ class OpenDNSSECInstance(service.Service):
ods_enforcerd = services.knownservices.ods_enforcerd
try:
- self.named_uid = pwd.getpwnam(named.get_user_name()).pw_uid
+ self.named_uid = pwd.getpwnam(constants.NAMED_USER).pw_uid
except KeyError:
raise RuntimeError("Named UID not found")
try:
- self.named_gid = grp.getgrnam(named.get_group_name()).gr_gid
+ self.named_gid = grp.getgrnam(constants.NAMED_GROUP).gr_gid
except KeyError:
raise RuntimeError("Named GID not found")
try:
- self.ods_uid = pwd.getpwnam(ods_enforcerd.get_user_name()).pw_uid
+ self.ods_uid = pwd.getpwnam(constants.ODS_USER).pw_uid
except KeyError:
raise RuntimeError("OpenDNSSEC UID not found")
try:
- self.ods_gid = grp.getgrnam(ods_enforcerd.get_group_name()).gr_gid
+ self.ods_gid = grp.getgrnam(constants.ODS_GROUP).gr_gid
except KeyError:
raise RuntimeError("OpenDNSSEC GID not found")
@@ -287,7 +288,7 @@ class OpenDNSSECInstance(service.Service):
ods_enforcerd = services.knownservices.ods_enforcerd
cmd = [paths.ODS_KSMUTIL, 'zonelist', 'export']
result = ipautil.run(cmd,
- runas=ods_enforcerd.get_user_name(),
+ runas=constants.ODS_USER,
capture_output=True)
with open(paths.OPENDNSSEC_ZONELIST_FILE, 'w') as zonelistf:
zonelistf.write(result.output)
@@ -303,7 +304,7 @@ class OpenDNSSECInstance(service.Service):
]
ods_enforcerd = services.knownservices.ods_enforcerd
- ipautil.run(command, stdin="y", runas=ods_enforcerd.get_user_name())
+ ipautil.run(command, stdin="y", runas=constants.ODS_USER)
def __setup_dnskeysyncd(self):
# set up dnskeysyncd this is DNSSEC master
@@ -352,7 +353,7 @@ class OpenDNSSECInstance(service.Service):
cmd = [paths.IPA_ODS_EXPORTER, 'ipa-full-update']
try:
self.print_msg("Exporting DNSSEC data before uninstallation")
- ipautil.run(cmd, runas=ods_enforcerd.get_user_name())
+ ipautil.run(cmd, runas=constants.ODS_USER)
except CalledProcessError:
root_logger.error("DNSSEC data export failed")