Import Upstream version 4.12.4
This commit is contained in:
10
ipaplatform/tencentos/__init__.py
Normal file
10
ipaplatform/tencentos/__init__.py
Normal file
@@ -0,0 +1,10 @@
|
||||
#
|
||||
# Copyright (C) 2024 FreeIPA Contributors see COPYING for license
|
||||
#
|
||||
|
||||
"""
|
||||
This module contains TencentOS specific platform files.
|
||||
|
||||
"""
|
||||
|
||||
NAME = "tencentos"
|
||||
23
ipaplatform/tencentos/constants.py
Normal file
23
ipaplatform/tencentos/constants.py
Normal file
@@ -0,0 +1,23 @@
|
||||
#
|
||||
# Copyright (C) 2024 FreeIPA Contributors see COPYING for license
|
||||
#
|
||||
|
||||
"""
|
||||
This TencentOS base platform module exports platform related constants.
|
||||
"""
|
||||
|
||||
# Fallback to default path definitions
|
||||
from __future__ import absolute_import
|
||||
|
||||
from ipaplatform.redhat.constants import RedHatConstantsNamespace, User, Group
|
||||
|
||||
|
||||
__all__ = ("constants", "User", "Group")
|
||||
|
||||
|
||||
class TencentOSConstantsNamespace(RedHatConstantsNamespace):
|
||||
SECURE_NFS_VAR = None
|
||||
NAMED_OPENSSL_ENGINE = "pkcs11"
|
||||
|
||||
|
||||
constants = TencentOSConstantsNamespace()
|
||||
20
ipaplatform/tencentos/paths.py
Normal file
20
ipaplatform/tencentos/paths.py
Normal file
@@ -0,0 +1,20 @@
|
||||
#
|
||||
# Copyright (C) 2024 FreeIPA Contributors see COPYING for license
|
||||
#
|
||||
|
||||
"""
|
||||
This TencentOS base platform module exports default filesystem paths
|
||||
as common in TencentOS-based systems.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from ipaplatform.redhat.paths import RedHatPathNamespace
|
||||
|
||||
|
||||
class TencentOSPathNamespace(RedHatPathNamespace):
|
||||
NAMED_CRYPTO_POLICY_FILE = "/etc/crypto-policies/back-ends/bind.config"
|
||||
SYSCONFIG_NFS = "/etc/nfs.conf"
|
||||
|
||||
|
||||
paths = TencentOSPathNamespace()
|
||||
51
ipaplatform/tencentos/services.py
Normal file
51
ipaplatform/tencentos/services.py
Normal file
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# Copyright (C) 2024 FreeIPA Contributors see COPYING for license
|
||||
#
|
||||
|
||||
|
||||
"""
|
||||
Contains TencentOS specific service class implementations.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
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
|
||||
tencentos_system_units = redhat_services.redhat_system_units.copy()
|
||||
tencentos_system_units["named"] = tencentos_system_units["named-regular"]
|
||||
tencentos_system_units["named-conflict"] = \
|
||||
tencentos_system_units["named-pkcs11"]
|
||||
|
||||
|
||||
# Service classes that implement TencentOS-specific behaviour
|
||||
|
||||
|
||||
class TencentOSService(redhat_services.RedHatService):
|
||||
system_units = tencentos_system_units
|
||||
|
||||
|
||||
# Function that constructs proper TencentOS-specific server classes for
|
||||
# services of specified name
|
||||
|
||||
|
||||
def tencentos_service_class_factory(name, api=None):
|
||||
if name in ["named", "named-conflict"]:
|
||||
return TencentOSService(name, api)
|
||||
return redhat_services.redhat_service_class_factory(name, api)
|
||||
|
||||
|
||||
# Magicdict containing TencentOSService instances.
|
||||
|
||||
|
||||
class TencentOSServices(redhat_services.RedHatServices):
|
||||
def service_class_factory(self, name, api=None):
|
||||
return tencentos_service_class_factory(name, api)
|
||||
|
||||
|
||||
# Objects below are expected to be exported by platform module
|
||||
|
||||
timedate_services = redhat_services.timedate_services
|
||||
service = tencentos_service_class_factory
|
||||
knownservices = TencentOSServices()
|
||||
18
ipaplatform/tencentos/tasks.py
Normal file
18
ipaplatform/tencentos/tasks.py
Normal file
@@ -0,0 +1,18 @@
|
||||
#
|
||||
# Copyright (C) 2024 FreeIPA Contributors see COPYING for license
|
||||
#
|
||||
|
||||
"""
|
||||
This module contains default TencentOS-specific implementations of system tasks.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from ipaplatform.redhat.tasks import RedHatTaskNamespace
|
||||
|
||||
|
||||
class TencentOSTaskNamespace(RedHatTaskNamespace):
|
||||
pass
|
||||
|
||||
|
||||
tasks = TencentOSTaskNamespace()
|
||||
Reference in New Issue
Block a user