This patch fixes https://fedorahosted.org/freeipa/ticket/5410

--
Martin^3 Babinsky
From 6c565cd6e25dec28ef98b987b2f8bf61d21de52d Mon Sep 17 00:00:00 2001
From: Martin Babinsky <mbabi...@redhat.com>
Date: Fri, 27 Nov 2015 14:05:21 +0100
Subject: [PATCH] perform IPA client uninstallation as a last step of server
 uninstall

With the ability to promote replicas from an enrolled client the
uninstallation procedure has to be changed slightly. If the client-side
components are not removed last during replica uninstallation, we can end up
with leftover ipa default.conf preventing future client re-enrollment.

https://fedorahosted.org/freeipa/ticket/5410
---
 ipaserver/install/server/install.py | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py
index c70ddac91f8c08719070874fa444e2f2430e3081..55d62a618e91c5968486317c5f57df862c1c7f52 100644
--- a/ipaserver/install/server/install.py
+++ b/ipaserver/install/server/install.py
@@ -1179,19 +1179,6 @@ def uninstall(installer):
     except Exception as e:
         pass
 
-    print("Removing IPA client configuration")
-    try:
-        (stdout, stderr, rc) = run([paths.IPA_CLIENT_INSTALL, "--on-master",
-                                    "--unattended", "--uninstall"],
-                                   raiseonerr=False)
-        if rc not in [0, 2]:
-            root_logger.debug("ipa-client-install returned %d" % rc)
-            raise RuntimeError(stdout)
-    except Exception as e:
-        rv = 1
-        print("Uninstall of client side components failed!")
-        print("ipa-client-install returned: " + str(e))
-
     ntpinstance.NTPInstance(fstore).uninstall()
 
     kra.uninstall(False)
@@ -1271,6 +1258,19 @@ def uninstall(installer):
                           ' # getcert stop-tracking -i <request_id>\n'
                           'for each id in: %s' % ', '.join(ids))
 
+    print("Removing IPA client configuration")
+    try:
+        (stdout, stderr, rc) = run([paths.IPA_CLIENT_INSTALL, "--on-master",
+                                    "--unattended", "--uninstall"],
+                                   raiseonerr=False)
+        if rc not in [0, 2]:
+            root_logger.debug("ipa-client-install returned %d" % rc)
+            raise RuntimeError(stdout)
+    except Exception as e:
+        rv = 1
+        print("Uninstall of client side components failed!")
+        print("ipa-client-install returned: " + str(e))
+
     sys.exit(rv)
 
 
-- 
2.4.3

-- 
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