summaryrefslogtreecommitdiffstats
path: root/ipaclient
diff options
context:
space:
mode:
authorFrançois Cami <fcami@redhat.com>2019-07-23 22:25:38 +0200
committerFrançois Cami <fcami@redhat.com>2019-07-26 10:49:54 +0200
commit5b65551b3107e46853afcc4901a60ea6e661a511 (patch)
tree28eb3d0dd1d1a47cb4dc87762d5ada7bfbfadf09 /ipaclient
parent68b85703d8ab2ede823d96e317dd106de27b108b (diff)
downloadfreeipa-5b65551b3107e46853afcc4901a60ea6e661a511.tar.gz
freeipa-5b65551b3107e46853afcc4901a60ea6e661a511.tar.xz
freeipa-5b65551b3107e46853afcc4901a60ea6e661a511.zip
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>
Diffstat (limited to 'ipaclient')
-rwxr-xr-xipaclient/install/ipa_client_samba.py7
1 files 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