https://fedorahosted.org/freeipa/ticket/5409

--
Martin^3 Babinsky
From 2b710f7dbc2017bfc0a0b090d55f631c7017f79f Mon Sep 17 00:00:00 2001
From: Martin Babinsky <mbabi...@redhat.com>
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
---
 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 b6f1b98c544f46608ecb4b9a3267ab733b916617..6c1c65618695d3035868dc9a931677728e8aab53 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:
             if options.ignore_topology_disconnect:
-- 
2.5.0

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to