mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
syncthing: Completely uninstall app
Remove config file when app is uninstalled Tests: 1. Install app and add a share 2. Reinstall app and confirm that the share doesn't exist The order of the functional tests should be modified since 'test_add_remove_folder' fails Signed-off-by: nbenedek <contact@nbenedek.me> [sunil: Update docstrings, make uninstall fail-safe] [sunil: Remove the entire configuration directory] Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
77318806c2
commit
f1d2139c2d
@ -143,3 +143,8 @@ class SyncthingApp(app_module.App):
|
||||
sharing.remove_share(name)
|
||||
sharing.add_share(name, share['path'], new_groups,
|
||||
share['is_public'])
|
||||
|
||||
def uninstall(self):
|
||||
"""De-configure and uninstall the app."""
|
||||
super().uninstall()
|
||||
privileged.uninstall()
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
|
||||
import grp
|
||||
import os
|
||||
import pathlib
|
||||
import pwd
|
||||
import shutil
|
||||
import subprocess
|
||||
@ -80,3 +81,9 @@ def setup_config():
|
||||
|
||||
if conf_changed:
|
||||
action_utils.service_try_restart('syncthing@syncthing')
|
||||
|
||||
|
||||
@privileged
|
||||
def uninstall():
|
||||
"""Remove configuration file when app is uninstalled."""
|
||||
shutil.rmtree(DATA_DIR + '/.config', ignore_errors=True)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user