summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Krizek <tkrizek@redhat.com>2016-10-26 16:12:25 +0200
committerMartin Basti <mbasti@redhat.com>2016-11-07 11:34:03 +0100
commitdf86efdc69271cca0774868ab85b5be7df529136 (patch)
treeaaff7710eebb99e0f8aabbdec3f26922b842a92f
parenta77469f5984b12e201a3d349efad1ca2925ee5af (diff)
install: ldap conn management
* Move connect to the beggining of the uninstall_check and properly close the connection at the end of the script. * Connect to ldap in external CA installation (step2). https://fedorahosted.org/freeipa/ticket/6461 Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
-rw-r--r--ipaserver/install/server/install.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py
index b8e531a56..ff99e78b4 100644
--- a/ipaserver/install/server/install.py
+++ b/ipaserver/install/server/install.py
@@ -14,7 +14,7 @@ import textwrap
import six
-from ipapython import certmonger, ipaldap, ipautil, sysrestore
+from ipapython import certmonger, ipautil, sysrestore
from ipapython.dn import DN
from ipapython.dnsutil import check_zone_overlap
from ipapython.install import core
@@ -752,6 +752,7 @@ def install(installer):
ntpinstance.ntp_ldap_enable(host_name, ds.suffix, realm_name)
else:
+ api.Backend.ldap2.connect()
ds = dsinstance.DsInstance(fstore=fstore,
domainlevel=options.domainlevel)
installer._ds = ds
@@ -984,10 +985,8 @@ def uninstall_check(installer):
raise ScriptError("Aborting uninstall operation.")
try:
- ldap_uri = ipaldap.get_ldap_uri(protocol='ldapi', realm=api.env.realm)
- conn = ipaldap.LDAPClient(ldap_uri)
- conn.external_bind()
api.Backend.ldap2.connect(autobind=True)
+
domain_level = dsinstance.get_domain_level(api)
except Exception:
msg = ("\nWARNING: Failed to connect to Directory Server to find "
@@ -1011,7 +1010,7 @@ def uninstall_check(installer):
realm=api.env.realm,
hostname=api.env.host,
dirman_passwd=None,
- conn=conn
+ conn=api.Backend.ldap2
)
agreements = rm.find_ipa_replication_agreements()
@@ -1035,6 +1034,8 @@ def uninstall_check(installer):
else:
remove_master_from_managed_topology(api, options)
+ api.Backend.ldap2.disconnect()
+
installer._fstore = fstore
installer._sstore = sstore