diff options
| author | François Cami <fcami@redhat.com> | 2019-07-24 09:41:19 +0200 |
|---|---|---|
| committer | François Cami <fcami@redhat.com> | 2019-07-26 10:49:54 +0200 |
| commit | cd2cbaecfce6b7b607619b34503b62c8afbbe594 (patch) | |
| tree | cebbee693c89a7c5f48b3f944d32945f9e67eb86 /ipaclient | |
| parent | ed6ee90c547cd27a3731f177dc9917176a714b49 (diff) | |
| download | freeipa-cd2cbaecfce6b7b607619b34503b62c8afbbe594.tar.gz freeipa-cd2cbaecfce6b7b607619b34503b62c8afbbe594.tar.xz freeipa-cd2cbaecfce6b7b607619b34503b62c8afbbe594.zip | |
ipa-client-samba: remove state on uninstall
The "domain_member" state was not removed at uninstall time.
Remove it so that future invocations of ipa-client-samba work.
Fixes: https://pagure.io/freeipa/issue/8021
Signed-off-by: François Cami <fcami@redhat.com>
https://pagure.io/freeipa/issue/8021
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Sergey Orlov <sorlov@redhat.com>
Diffstat (limited to 'ipaclient')
| -rwxr-xr-x | ipaclient/install/ipa_client_samba.py | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/ipaclient/install/ipa_client_samba.py b/ipaclient/install/ipa_client_samba.py index 6a3c3bd80..126ef32d7 100755 --- a/ipaclient/install/ipa_client_samba.py +++ b/ipaclient/install/ipa_client_samba.py @@ -523,11 +523,25 @@ def run(): if options.uninstall: if statestore.has_state("domain_member"): uninstall(fstore, statestore, options) - print( - "Samba configuration is reverted. " - "However, Samba databases were fully cleaned and " - "old configuration file will not be usable anymore." - ) + try: + keys = ( + "configured", "hardening", "groupmap", "tdb", + "service.principal", "smb.conf" + ) + for key in keys: + statestore.delete_state("domain_member", key) + except Exception as e: + print( + "Error: Failed to remove the domain_member statestores: " + "%s" % e + ) + return 1 + else: + print( + "Samba configuration is reverted. " + "However, Samba databases were fully cleaned and " + "old configuration file will not be usable anymore." + ) else: print("Samba domain member is not configured yet") return 0 |
