diff options
author | Timo Aaltonen <tjaalton@debian.org> | 2016-03-18 12:22:33 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-03-23 13:32:55 +0100 |
commit | 2a2d63669d740396eabc6f46906b8625f001ad3c (patch) | |
tree | 08688e009a46057e86f6198d42ced3289d00a23c /ipaserver/install/dnskeysyncinstance.py | |
parent | d58cd04e8a618b0bf33d36099f782149c93dbd33 (diff) | |
download | freeipa-2a2d63669d740396eabc6f46906b8625f001ad3c.tar.gz freeipa-2a2d63669d740396eabc6f46906b8625f001ad3c.tar.xz freeipa-2a2d63669d740396eabc6f46906b8625f001ad3c.zip |
ipaplatform: Move remaining user/group constants to ipaplatform.constants.
Use ipaplatform.constants in every corner instead of importing other bits or calling
some platform specific things, and remove most of the remaining hardcoded uid's.
https://fedorahosted.org/freeipa/ticket/5343
Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipaserver/install/dnskeysyncinstance.py')
-rw-r--r-- | ipaserver/install/dnskeysyncinstance.py | 9 |
1 files changed, 5 insertions, 4 deletions
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") |