On 12/10/2015 02:18 PM, Tomas Babej wrote:
> During the promote_check phase, the subsequent checks after the machine
> is enrolled may cause the installation to abort, hence leaving it
> enrolled even though it might not have been prior to the execution of
> the ipa-replica-install command.
> Make sure that ipa-client-install --uninstall is called on the machine
> that has not been enrolled before in case of failure during the
> promote_check phase.
Self-NACK, installer is redundant for uninstall_client.
Updated patch attached.
From b6e88996206aa6695be24449653f91894c329f3b Mon Sep 17 00:00:00 2001
From: Tomas Babej <tba...@redhat.com>
Date: Thu, 10 Dec 2015 14:10:18 +0100
Subject: [PATCH] replicainstall: Make sure the enrollment state is preserved
During the promote_check phase, the subsequent checks after the machine
is enrolled may cause the installation to abort, hence leaving it
enrolled even though it might not have been prior to the execution of
the ipa-replica-install command.
Make sure that ipa-client-install --uninstall is called on the machine
that has not been enrolled before in case of failure during the
ipaserver/install/server/replicainstall.py | 32 ++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py
index 4443bfd437f5b291182f65dd2a1ad2afe0ff89bc..e92d50a56e8416eb14e0526c684d9558c9ff91d5 100644
@@ -385,6 +385,34 @@ def common_cleanup(func):
+ Makes sure the machine is unenrollled if the decorated function
+ def decorated(installer):
+ except BaseException:
+ if installer._enrollment_performed:
+ return decorated
+ Attempts to unenroll the IPA client using the ipa-client-install utility.
+ An unsuccessful attempt to uninstall is ignored (no exception raised).
+ print("Removing client side components")
+ ipautil.run([paths.IPA_CLIENT_INSTALL, "--unattended", "--uninstall"],
sssdconfig = SSSDConfig.SSSDConfig()
@@ -786,6 +814,8 @@ def ensure_enrolled(installer):
# Call client install script
service.print_msg("Configuring client side components")
+ installer._enrollment_performed = True
args = [paths.IPA_CLIENT_INSTALL, "--unattended"]
@@ -821,9 +851,11 @@ def ensure_enrolled(installer):
"ipa-client-install returned: " + str(e))
options = installer
+ installer._enrollment_performed = False
installer._top_dir = tempfile.mkdtemp("ipa")
Manage your subscription for the Freeipa-devel mailing list:
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code