mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Use nis-domainname.service on all RH platforms
RHEL 8 and Fedora >= 29 use "nis-domainname.service" as service name for domainname service. Remove special code in ipaplatform.rhel and for Fedora < 28. Only Fedora 29+ is supported by IPA 4.8. Fixes: https://pagure.io/freeipa/issue/8004 Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
parent
56b1b5ac5b
commit
d2c929270c
@ -24,21 +24,12 @@ Contains Fedora-specific service class implementations.
|
|||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from ipaplatform.osinfo import osinfo
|
|
||||||
from ipaplatform.redhat import services as redhat_services
|
from ipaplatform.redhat import services as redhat_services
|
||||||
|
|
||||||
# Mappings from service names as FreeIPA code references to these services
|
# Mappings from service names as FreeIPA code references to these services
|
||||||
# to their actual systemd service names
|
# to their actual systemd service names
|
||||||
fedora_system_units = redhat_services.redhat_system_units.copy()
|
fedora_system_units = redhat_services.redhat_system_units.copy()
|
||||||
|
|
||||||
# Fedora 28 and earlier have fedora-domainname.service. Starting from
|
|
||||||
# Fedora 29, the service is called nis-domainname.service as defined in
|
|
||||||
# ipaplatform.redhat.services.
|
|
||||||
HAS_FEDORA_DOMAINNAME_SERVICE = osinfo.version_number <= (28,)
|
|
||||||
|
|
||||||
if HAS_FEDORA_DOMAINNAME_SERVICE:
|
|
||||||
fedora_system_units['domainname'] = 'fedora-domainname.service'
|
|
||||||
|
|
||||||
|
|
||||||
# Service classes that implement Fedora-specific behaviour
|
# Service classes that implement Fedora-specific behaviour
|
||||||
|
|
||||||
@ -50,8 +41,6 @@ class FedoraService(redhat_services.RedHatService):
|
|||||||
# of specified name
|
# of specified name
|
||||||
|
|
||||||
def fedora_service_class_factory(name, api=None):
|
def fedora_service_class_factory(name, api=None):
|
||||||
if HAS_FEDORA_DOMAINNAME_SERVICE and name == 'domainname':
|
|
||||||
return FedoraService(name, api)
|
|
||||||
return redhat_services.redhat_service_class_factory(name, api)
|
return redhat_services.redhat_service_class_factory(name, api)
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,10 +28,7 @@ from ipaplatform.redhat import services as redhat_services
|
|||||||
|
|
||||||
# Mappings from service names as FreeIPA code references to these services
|
# Mappings from service names as FreeIPA code references to these services
|
||||||
# to their actual systemd service names
|
# to their actual systemd service names
|
||||||
rhel_system_units = redhat_services.redhat_system_units
|
rhel_system_units = redhat_services.redhat_system_units.copy()
|
||||||
|
|
||||||
# Service that sets domainname on RHEL is called rhel-domainname.service
|
|
||||||
rhel_system_units['domainname'] = 'rhel-domainname.service'
|
|
||||||
|
|
||||||
|
|
||||||
# Service classes that implement RHEL-specific behaviour
|
# Service classes that implement RHEL-specific behaviour
|
||||||
@ -44,8 +41,6 @@ class RHELService(redhat_services.RedHatService):
|
|||||||
# of specified name
|
# of specified name
|
||||||
|
|
||||||
def rhel_service_class_factory(name, api=None):
|
def rhel_service_class_factory(name, api=None):
|
||||||
if name == 'domainname':
|
|
||||||
return RHELService(name, api)
|
|
||||||
return redhat_services.redhat_service_class_factory(name, api)
|
return redhat_services.redhat_service_class_factory(name, api)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user