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

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Martin Babinsky 2015-11-27 14:05:21 +01:00 committed by Martin Basti
parent 4854850867
commit f6240f21fc

View File

@ -1046,19 +1046,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)
@ -1138,6 +1125,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)