mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Properly bootstrap replica promotion api
Properly bootstrap api in replica promote_check() so that it can be used later in the installation for setting up dns. https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
parent
ba4df6449a
commit
1fc128b05f
@ -1092,8 +1092,10 @@ def promote_check(installer):
|
|||||||
env._finalize_core(**dict(constants.DEFAULT_CONFIG))
|
env._finalize_core(**dict(constants.DEFAULT_CONFIG))
|
||||||
|
|
||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
|
xmlrpc_uri = 'https://{}/ipa/xml'.format(ipautil.format_netloc(env.host))
|
||||||
api.bootstrap(in_server=True, context='installer',
|
api.bootstrap(in_server=True, context='installer',
|
||||||
ldap_uri=installutils.realm_to_ldapi_uri(env.realm))
|
ldap_uri=installutils.realm_to_ldapi_uri(env.realm),
|
||||||
|
xmlrpc_uri=xmlrpc_uri)
|
||||||
# pylint: enable=no-member
|
# pylint: enable=no-member
|
||||||
api.finalize()
|
api.finalize()
|
||||||
|
|
||||||
@ -1545,17 +1547,11 @@ def promote(installer):
|
|||||||
promote_sssd(config.host_name)
|
promote_sssd(config.host_name)
|
||||||
promote_openldap_conf(config.host_name, config.master_host_name)
|
promote_openldap_conf(config.host_name, config.master_host_name)
|
||||||
|
|
||||||
# Switch API so that it uses the new servr configuration
|
|
||||||
server_api = create_api(mode=None)
|
|
||||||
server_api.bootstrap(in_server=True, context='installer')
|
|
||||||
server_api.finalize()
|
|
||||||
|
|
||||||
server_api.Backend.ldap2.connect(autobind=True)
|
|
||||||
if options.setup_dns:
|
if options.setup_dns:
|
||||||
dns.install(False, True, options, server_api)
|
dns.install(False, True, options, api)
|
||||||
else:
|
else:
|
||||||
server_api.Command.dns_update_system_records()
|
api.Command.dns_update_system_records()
|
||||||
server_api.Backend.ldap2.disconnect()
|
api.Backend.ldap2.disconnect()
|
||||||
|
|
||||||
# Everything installed properly, activate ipa service.
|
# Everything installed properly, activate ipa service.
|
||||||
services.knownservices.ipa.enable()
|
services.knownservices.ipa.enable()
|
||||||
|
Loading…
Reference in New Issue
Block a user