summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/server/replicainstall.py
diff options
context:
space:
mode:
authorStanislav Laznicka <slaznick@redhat.com>2016-11-08 12:51:58 +0100
committerJan Cholasta <jcholast@redhat.com>2016-11-11 12:17:25 +0100
commit1fc128b05fd13a3f400346cc6d2e7fb5f66875ac (patch)
tree5e95e9ed14ff86870d162fb813fe0702ffec287d /ipaserver/install/server/replicainstall.py
parentba4df6449aaa0843ab43a1a2b3cb1df8bb022c24 (diff)
downloadfreeipa-1fc128b05fd13a3f400346cc6d2e7fb5f66875ac.tar.gz
freeipa-1fc128b05fd13a3f400346cc6d2e7fb5f66875ac.tar.xz
freeipa-1fc128b05fd13a3f400346cc6d2e7fb5f66875ac.zip
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>
Diffstat (limited to 'ipaserver/install/server/replicainstall.py')
-rw-r--r--ipaserver/install/server/replicainstall.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py
index 21bcd8691..fdc9a9dee 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()