ipa-client-samba: remove and restore smb.conf only on first uninstall

Fixes: https://pagure.io/freeipa/issue/8019
Signed-off-by: François Cami <fcami@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Sergey Orlov <sorlov@redhat.com>
This commit is contained in:
François Cami 2019-07-23 22:25:38 +02:00
parent 68b85703d8
commit 5b65551b31

View File

@ -433,8 +433,9 @@ def uninstall(fstore, statestore, options):
ipautil.remove_ccache(ccache_path=paths.KRB5CC_SAMBA)
# Remove samba's configuration file
ipautil.remove_file(paths.SMB_CONF)
fstore.restore_file(paths.SMB_CONF)
if fstore.has_file(paths.SMB_CONF):
ipautil.remove_file(paths.SMB_CONF)
fstore.restore_file(paths.SMB_CONF)
# Remove samba's persistent and temporary tdb files
tdb_files = [
@ -624,7 +625,7 @@ def run():
api.Command.service_del(api.env.smb_princ)
except AttributeError:
logger.error(
"Chosen IPA master %s does not have support to"
"Chosen IPA master %s does not have support to "
"set up Samba domain members", server,
)
return 1