samba: Remove additional configuration files on uninstall

Tests:

- Uninstall samba. Notice that /etc/default/samba and
/etc/samba/smb-freedombox.conf are removed.

- Reinstall samba and notice that the two files are restored to their expected
content.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2023-06-06 10:34:36 -07:00 committed by James Valleroy
parent b47ea8346b
commit 414553ad93
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -3,6 +3,7 @@
import configparser
import os
import pathlib
import shutil
import subprocess
@ -312,3 +313,6 @@ def restore_shares():
def uninstall():
"""Drop all Samba shares."""
_conf_command(['drop'])
for path in [CONF_PATH, DEFAULT_FILE]:
# Both files are typically created on setup()
pathlib.Path(path).unlink(missing_ok=True)