Imported Upstream version 4.3.1
This commit is contained in:
@@ -20,14 +20,3 @@
|
||||
'''
|
||||
This module contains Fedora specific platform files.
|
||||
'''
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
NAME = 'fedora'
|
||||
|
||||
if sys.version_info < (3, 6):
|
||||
warnings.warn(
|
||||
"Support for Python 2.7 and 3.5 is deprecated. Python version "
|
||||
"3.6 or newer will be required in the next major release.",
|
||||
category=DeprecationWarning
|
||||
)
|
||||
|
||||
@@ -7,21 +7,10 @@ This Fedora base platform module exports platform related constants.
|
||||
'''
|
||||
|
||||
# Fallback to default constant definitions
|
||||
from __future__ import absolute_import
|
||||
|
||||
from ipaplatform.redhat.constants import RedHatConstantsNamespace
|
||||
|
||||
|
||||
class FedoraConstantsNamespace(RedHatConstantsNamespace):
|
||||
# Fedora allows installation of Python 2 and 3 mod_wsgi, but the modules
|
||||
# can't coexist. For Apache to load correct module.
|
||||
MOD_WSGI_PYTHON2 = "modules/mod_wsgi.so"
|
||||
MOD_WSGI_PYTHON3 = "modules/mod_wsgi_python3.so"
|
||||
|
||||
# System-wide crypto policy, but without TripleDES, pre-shared key,
|
||||
# secure remote password, and DSA cert authentication.
|
||||
# see https://fedoraproject.org/wiki/Changes/CryptoPolicy
|
||||
TLS_HIGH_CIPHERS = "PROFILE=SYSTEM:!3DES:!PSK:!SRP:!aDSS"
|
||||
|
||||
pass
|
||||
|
||||
constants = FedoraConstantsNamespace()
|
||||
|
||||
@@ -23,16 +23,11 @@ in Fedora-based systems.
|
||||
'''
|
||||
|
||||
# Fallback to default path definitions
|
||||
from __future__ import absolute_import
|
||||
|
||||
from ipaplatform.redhat.paths import RedHatPathNamespace
|
||||
|
||||
|
||||
class FedoraPathNamespace(RedHatPathNamespace):
|
||||
HTTPD_IPA_WSGI_MODULES_CONF = (
|
||||
"/etc/httpd/conf.modules.d/02-ipa-wsgi.conf"
|
||||
)
|
||||
NAMED_CRYPTO_POLICY_FILE = "/etc/crypto-policies/back-ends/bind.config"
|
||||
pass
|
||||
|
||||
|
||||
paths = FedoraPathNamespace()
|
||||
|
||||
@@ -22,22 +22,14 @@
|
||||
Contains Fedora-specific service class implementations.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from ipaplatform.osinfo import osinfo
|
||||
from ipaplatform.redhat import services as redhat_services
|
||||
|
||||
# Mappings from service names as FreeIPA code references to these services
|
||||
# to their actual systemd service names
|
||||
fedora_system_units = redhat_services.redhat_system_units.copy()
|
||||
fedora_system_units = redhat_services.redhat_system_units
|
||||
|
||||
# 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 = int(osinfo.version_id) <= 28
|
||||
|
||||
if HAS_FEDORA_DOMAINNAME_SERVICE:
|
||||
fedora_system_units['domainname'] = 'fedora-domainname.service'
|
||||
# Service that sets domainname on Fedora is called fedora-domainname.service
|
||||
fedora_system_units['domainname'] = 'fedora-domainname.service'
|
||||
|
||||
|
||||
# Service classes that implement Fedora-specific behaviour
|
||||
@@ -49,21 +41,21 @@ class FedoraService(redhat_services.RedHatService):
|
||||
# Function that constructs proper Fedora-specific server classes for services
|
||||
# of specified name
|
||||
|
||||
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)
|
||||
def fedora_service_class_factory(name):
|
||||
if name == 'domainname':
|
||||
return FedoraService(name)
|
||||
return redhat_services.redhat_service_class_factory(name)
|
||||
|
||||
|
||||
# Magicdict containing FedoraService instances.
|
||||
|
||||
class FedoraServices(redhat_services.RedHatServices):
|
||||
def service_class_factory(self, name, api=None):
|
||||
return fedora_service_class_factory(name, api)
|
||||
def service_class_factory(self, name):
|
||||
return fedora_service_class_factory(name)
|
||||
|
||||
|
||||
# Objects below are expected to be exported by platform module
|
||||
|
||||
timedate_services = redhat_services.timedate_services
|
||||
from ipaplatform.redhat.services import timedate_services
|
||||
service = fedora_service_class_factory
|
||||
knownservices = FedoraServices()
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
This module contains default Fedora-specific implementations of system tasks.
|
||||
'''
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from ipaplatform.redhat.tasks import RedHatTaskNamespace
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user