From 1fc128b05fd13a3f400346cc6d2e7fb5f66875ac Mon Sep 17 00:00:00 2001 From: Stanislav Laznicka Date: Nov 11 2016 11:17:25 +0000 Subject: 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 Reviewed-By: Jan Cholasta --- diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py index 21bcd86..fdc9a9d 100644 --- a/ipaserver/install/server/replicainstall.py +++ b/ipaserver/install/server/replicainstall.py @@ -1092,8 +1092,10 @@ def promote_check(installer): env._finalize_core(**dict(constants.DEFAULT_CONFIG)) # pylint: disable=no-member + xmlrpc_uri = 'https://{}/ipa/xml'.format(ipautil.format_netloc(env.host)) 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 api.finalize() @@ -1545,17 +1547,11 @@ def promote(installer): promote_sssd(config.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: - dns.install(False, True, options, server_api) + dns.install(False, True, options, api) else: - server_api.Command.dns_update_system_records() - server_api.Backend.ldap2.disconnect() + api.Command.dns_update_system_records() + api.Backend.ldap2.disconnect() # Everything installed properly, activate ipa service. services.knownservices.ipa.enable()