mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-07-29 15:55:47 -05:00
Replace ipaplatform's symlinks with a meta importer
Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Petr Spacek <pspacek@redhat.com>
This commit is contained in:
committed by
David Kupka
parent
a420592280
commit
8f98fa1bd5
@@ -77,7 +77,3 @@ freeipa2-dev-doc
|
|||||||
|
|
||||||
/ipaplatform/__init__.py
|
/ipaplatform/__init__.py
|
||||||
/ipaplatform/setup.py
|
/ipaplatform/setup.py
|
||||||
/ipaplatform/tasks.py
|
|
||||||
/ipaplatform/services.py
|
|
||||||
/ipaplatform/paths.py
|
|
||||||
/ipaplatform/constants.py
|
|
||||||
|
|||||||
@@ -197,11 +197,6 @@ version-update: release-update
|
|||||||
if [ "$(SUPPORTED_PLATFORM)" != "" ]; then \
|
if [ "$(SUPPORTED_PLATFORM)" != "" ]; then \
|
||||||
sed -e s/__PLATFORM__/$(SUPPORTED_PLATFORM)/ \
|
sed -e s/__PLATFORM__/$(SUPPORTED_PLATFORM)/ \
|
||||||
ipaplatform/__init__.py.in > ipaplatform/__init__.py; \
|
ipaplatform/__init__.py.in > ipaplatform/__init__.py; \
|
||||||
rm -f ipaplatform/paths.py ipaplatform/services.py ipaplatform/tasks.py ipaplatform/constants.py; \
|
|
||||||
ln -s $(SUPPORTED_PLATFORM)/paths.py ipaplatform/paths.py; \
|
|
||||||
ln -s $(SUPPORTED_PLATFORM)/services.py ipaplatform/services.py; \
|
|
||||||
ln -s $(SUPPORTED_PLATFORM)/tasks.py ipaplatform/tasks.py; \
|
|
||||||
ln -s $(SUPPORTED_PLATFORM)/constants.py ipaplatform/constants.py; \
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(SKIP_API_VERSION_CHECK)" != "yes" ]; then \
|
if [ "$(SKIP_API_VERSION_CHECK)" != "yes" ]; then \
|
||||||
|
|||||||
@@ -1,12 +1,20 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
|
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
|
||||||
#
|
#
|
||||||
|
"""Module containing platform-specific functionality.
|
||||||
|
|
||||||
|
ipaplatform.constants
|
||||||
|
ipaplatform.paths
|
||||||
|
ipaplatform.services
|
||||||
|
ipaplatform.tasks
|
||||||
|
"""
|
||||||
|
import os
|
||||||
|
|
||||||
'''
|
|
||||||
Module containing platform-specific functionality for every platform.
|
|
||||||
'''
|
|
||||||
|
|
||||||
NAME = "__PLATFORM__"
|
NAME = "__PLATFORM__"
|
||||||
|
|
||||||
# FIXME: too much cyclic dependencies
|
# Create an alias for platform specific modulues, e.g.
|
||||||
# from __PLATFORM__ import paths, tasks, services
|
# 'import ipaplatform.paths' loads 'ipaplatform/NAME/paths.py'.
|
||||||
|
|
||||||
|
__path__.append(
|
||||||
|
os.path.join(os.path.dirname(os.path.abspath(__file__)), NAME))
|
||||||
|
|||||||
@@ -483,7 +483,10 @@ class SystemdService(PlatformService):
|
|||||||
|
|
||||||
# Objects below are expected to be exported by platform module
|
# Objects below are expected to be exported by platform module
|
||||||
|
|
||||||
service = None
|
def base_service_class_factory(name):
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
|
service = base_service_class_factory
|
||||||
knownservices = None
|
knownservices = None
|
||||||
|
|
||||||
# System may support more time&date services. FreeIPA supports ntpd only, other
|
# System may support more time&date services. FreeIPA supports ntpd only, other
|
||||||
|
|||||||
+1
-1
@@ -58,7 +58,7 @@ from dns.exception import DNSException
|
|||||||
import pysss_nss_idmap
|
import pysss_nss_idmap
|
||||||
import pysss
|
import pysss
|
||||||
import six
|
import six
|
||||||
from ipaplatform.paths import paths
|
from ipaplatform.paths import paths # pylint: disable=import-error
|
||||||
|
|
||||||
from ldap.filter import escape_filter_chars
|
from ldap.filter import escape_filter_chars
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|||||||
+19
-1
@@ -6,9 +6,11 @@ from __future__ import print_function
|
|||||||
|
|
||||||
import copy
|
import copy
|
||||||
import sys
|
import sys
|
||||||
|
import textwrap
|
||||||
|
|
||||||
from astroid import MANAGER
|
from astroid import MANAGER, register_module_extender
|
||||||
from astroid import scoped_nodes
|
from astroid import scoped_nodes
|
||||||
|
from astroid.builder import AstroidBuilder
|
||||||
|
|
||||||
|
|
||||||
def register(linter):
|
def register(linter):
|
||||||
@@ -255,3 +257,19 @@ def fix_ipa_classes(cls):
|
|||||||
fake_class(cls, ipa_class_members[class_name_with_module])
|
fake_class(cls, ipa_class_members[class_name_with_module])
|
||||||
|
|
||||||
MANAGER.register_transform(scoped_nodes.Class, fix_ipa_classes)
|
MANAGER.register_transform(scoped_nodes.Class, fix_ipa_classes)
|
||||||
|
|
||||||
|
|
||||||
|
def ipaplatform_transform():
|
||||||
|
"""Module aliases for IpaPlatformImporter
|
||||||
|
"""
|
||||||
|
return AstroidBuilder(MANAGER).string_build(textwrap.dedent(
|
||||||
|
"""
|
||||||
|
from ipaplatform.base import constants
|
||||||
|
from ipaplatform.base import paths
|
||||||
|
from ipaplatform.base import services
|
||||||
|
from ipaplatform.base import tasks
|
||||||
|
"""
|
||||||
|
))
|
||||||
|
|
||||||
|
|
||||||
|
register_module_extender(MANAGER, 'ipaplatform', ipaplatform_transform)
|
||||||
|
|||||||
Reference in New Issue
Block a user