mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Unify and simplify LDAP service discovery
Move LDAP service discovery and service definitions from ipaserver.install to ipaserver. Simplify and unify different implementations in favor of a single implementation. Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
@@ -35,6 +35,7 @@ from ipaserver.install.installutils import check_creds, ReplicaConfig
|
||||
from ipaserver.install import dsinstance, ca
|
||||
from ipaserver.install import cainstance, service
|
||||
from ipaserver.install import custodiainstance
|
||||
from ipaserver.masters import find_providing_server
|
||||
from ipapython import version
|
||||
from ipalib import api
|
||||
from ipalib.constants import DOMAIN_LEVEL_1
|
||||
@@ -183,8 +184,9 @@ def install_replica(safe_options, options):
|
||||
config.subject_base = attrs.get('ipacertificatesubjectbase')[0]
|
||||
|
||||
if config.ca_host_name is None:
|
||||
config.ca_host_name = \
|
||||
service.find_providing_server('CA', api.Backend.ldap2, api.env.ca_host)
|
||||
config.ca_host_name = find_providing_server(
|
||||
'CA', api.Backend.ldap2, [api.env.ca_host]
|
||||
)
|
||||
|
||||
options.realm_name = config.realm_name
|
||||
options.domain_name = config.domain_name
|
||||
@@ -258,7 +260,8 @@ def install(safe_options, options):
|
||||
paths.KRB5_KEYTAB,
|
||||
ccache)
|
||||
|
||||
ca_host = service.find_providing_server('CA', api.Backend.ldap2)
|
||||
ca_host = find_providing_server('CA', api.Backend.ldap2)
|
||||
|
||||
if ca_host is None:
|
||||
install_master(safe_options, options)
|
||||
else:
|
||||
|
||||
@@ -224,9 +224,9 @@ def get_config(dirsrv):
|
||||
svc_list.append([order, name])
|
||||
|
||||
ordered_list = []
|
||||
for (order, svc) in sorted(svc_list):
|
||||
for order, svc in sorted(svc_list):
|
||||
if svc in service.SERVICE_LIST:
|
||||
ordered_list.append(service.SERVICE_LIST[svc][0])
|
||||
ordered_list.append(service.SERVICE_LIST[svc].systemd_name)
|
||||
return ordered_list
|
||||
|
||||
def get_config_from_file():
|
||||
|
||||
Reference in New Issue
Block a user