mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
client uninstall: handle uninstall with authconfig
If the client was installed with authconfig, with automount configured to use ldap (--no-sssd), and later updated to a version using authselect, the uninstaller tries to disable the authselect feature with-custom-automount but fails because there is no authselect profile in use. (Upgrade of a client does not transform authconfig settings into authselect settings because we don't have any client upgrader, as opposed to the ipa-server-upgrade for the servers). To avoid uninstallation failure, ignore the error and log a warning. The second part of the commit leverages the "complete" state stored in the statestore, in order to fix issues when a client installation fails and the installation is reverted by the ipa-client-install tool itself. The fix checks if the statestore shows an incomplete installation. If the install was incomplete and failed before any attempt to configure authselect, then unconfigure doesn't need to do anything. In the other cases, unconfigure needs to revert to the pre-ipa state. Fixes: https://pagure.io/freeipa/issue/9147 Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
parent
c2e79fa0b6
commit
ce0592bd47
@ -129,7 +129,14 @@ class RedHatAuthSelect(RedHatAuthToolBase):
|
||||
def unconfigure(
|
||||
self, fstore, statestore, was_sssd_installed, was_sssd_configured
|
||||
):
|
||||
if not statestore.has_state('authselect') and was_sssd_installed:
|
||||
# If the installation failed before doing the authselect part
|
||||
# nothing to do here
|
||||
complete = statestore.get_state('installation', 'complete')
|
||||
if complete is not None and not complete and \
|
||||
not statestore.has_state('authselect'):
|
||||
return
|
||||
|
||||
if not statestore.has_state('authselect'):
|
||||
logger.warning(
|
||||
"WARNING: Unable to revert to the pre-installation state "
|
||||
"('authconfig' tool has been deprecated in favor of "
|
||||
|
@ -765,6 +765,12 @@ class RedHatTaskNamespace(BaseTaskNamespace):
|
||||
|
||||
authselect_cmd = [paths.AUTHSELECT, "disable-feature",
|
||||
"with-custom-automount"]
|
||||
ipautil.run(authselect_cmd)
|
||||
try:
|
||||
ipautil.run(authselect_cmd)
|
||||
except ipautil.CalledProcessError:
|
||||
logger.info("Unable to disable with-custom-automount feature")
|
||||
logger.info("It may happen if the configuration was done "
|
||||
"using authconfig instead of authselect")
|
||||
|
||||
|
||||
tasks = RedHatTaskNamespace()
|
||||
|
Loading…
Reference in New Issue
Block a user