From 4cc206b0f82dd68d615f0aebba5b03acf127f53a Mon Sep 17 00:00:00 2001 From: Martin Babinsky Date: Fri, 4 Dec 2015 20:29:18 +0100 Subject: [PATCH] prevent crashes of server uninstall check caused by failed LDAP connections https://fedorahosted.org/freeipa/ticket/5409 Reviewed-By: Martin Basti --- ipaserver/install/server/install.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py index 613a940c6..f1c600644 100644 --- a/ipaserver/install/server/install.py +++ b/ipaserver/install/server/install.py @@ -1091,6 +1091,8 @@ def uninstall_check(installer): realm=api.env.realm ) conn.do_external_bind(pwd.getpwuid(os.geteuid()).pw_name) + 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 " "information about replication agreements. Uninstallation " @@ -1098,9 +1100,7 @@ def uninstall_check(installer): "agreements.\n\n") print(textwrap.fill(msg, width=80, replace_whitespace=False)) else: - api.Backend.ldap2.connect(autobind=True) dns.uninstall_check(options) - domain_level = dsinstance.get_domain_level(api) if domain_level == constants.DOMAIN_LEVEL_0: rm = replication.ReplicationManager(