mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-09-03 20:52:56 -05:00
Use namespace-aware meta importer for ipaplatform
Instead of symlinks and build-time configuration the ipaplatform module is now able to auto-detect platforms on import time. The meta importer uses the platform 'ID' from /etc/os-releases. It falls back to 'ID_LIKE' on platforms like CentOS, which has ID=centos and ID_LIKE="rhel fedora". The meta importer is able to handle namespace packages and the ipaplatform package has been turned into a namespace package in order to support external platform specifications. https://fedorahosted.org/freeipa/ticket/6474 Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
+3
-10
@@ -16,6 +16,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
from __future__ import absolute_import
|
||||
|
||||
# pylint: disable=deprecated-module
|
||||
from optparse import (
|
||||
@@ -33,18 +34,10 @@ from six.moves.configparser import SafeConfigParser
|
||||
from six.moves.urllib.parse import urlsplit
|
||||
# pylint: enable=import-error
|
||||
|
||||
from ipaplatform.paths import paths
|
||||
from ipapython.dn import DN
|
||||
from ipapython.ipautil import CheckedIPAddress, CheckedIPAddressLoopback
|
||||
|
||||
try:
|
||||
# pylint: disable=ipa-forbidden-import
|
||||
from ipaplatform.paths import paths
|
||||
# pylint: enable=ipa-forbidden-import
|
||||
except ImportError:
|
||||
IPA_DEFAULT_CONF = '/etc/ipa/default.conf'
|
||||
else:
|
||||
IPA_DEFAULT_CONF = paths.IPA_DEFAULT_CONF
|
||||
|
||||
|
||||
class IPAConfigError(Exception):
|
||||
def __init__(self, msg=''):
|
||||
@@ -188,7 +181,7 @@ config = IPAConfig()
|
||||
|
||||
def __parse_config(discover_server = True):
|
||||
p = SafeConfigParser()
|
||||
p.read(IPA_DEFAULT_CONF)
|
||||
p.read(paths.IPA_DEFAULT_CONF)
|
||||
|
||||
try:
|
||||
if not config.default_realm:
|
||||
|
||||
Reference in New Issue
Block a user