mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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>
This commit is contained in:
parent
ed6ee90c54
commit
cd2cbaecfc
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user