samba: Completely uninstall app

Drop all Samba shares when app is uninstalled

Test:
1. Install app, enable  Open Share and  Group Share
2. Reinstall app and confirm all shares get dropped

Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
nbenedek 2023-04-11 20:48:51 +02:00 committed by Sunil Mohan Adapa
parent 4d7651c89f
commit f52bfab993
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 11 additions and 0 deletions

View File

@ -102,6 +102,11 @@ class SambaApp(app_module.App):
if not old_version:
self.enable()
def uninstall(self):
"""De-configure and uninstall the app."""
super().uninstall()
privileged.uninstall()
class SambaBackupRestore(BackupRestore):
"""Component to backup/restore Samba."""

View File

@ -306,3 +306,9 @@ def restore_shares():
'Backup file {0} does not exist.'.format(SHARES_CONF_BACKUP_FILE))
_conf_command(['drop'])
_conf_command(['import', SHARES_CONF_BACKUP_FILE])
@privileged
def uninstall():
"""Drop all Samba shares."""
_conf_command(['drop'])