From 5b65551b3107e46853afcc4901a60ea6e661a511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Cami?= Date: Tue, 23 Jul 2019 22:25:38 +0200 Subject: [PATCH] ipa-client-samba: remove and restore smb.conf only on first uninstall MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://pagure.io/freeipa/issue/8019 Signed-off-by: François Cami Reviewed-By: Alexander Bokovoy Reviewed-By: Sergey Orlov --- ipaclient/install/ipa_client_samba.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ipaclient/install/ipa_client_samba.py b/ipaclient/install/ipa_client_samba.py index e2be67d14..6a3c3bd80 100755 --- a/ipaclient/install/ipa_client_samba.py +++ b/ipaclient/install/ipa_client_samba.py @@ -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