mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-19 12:36:06 +00:00
openvpn: Completely uninstall app
Remove /etc/openvpn when the app is uninstalled * Tests: 1. Uninstall app and manually check if /etc/openvpn gets removed 2. Sucessfully install app 3. Functional tests: passed 4. In case we choose to purge packages in the future: I checked purging openvpn and it will not remove /etc/openvpn. 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:
parent
7e960e7491
commit
4d7651c89f
@ -91,3 +91,8 @@ class OpenVPNApp(app_module.App):
|
||||
super().setup(old_version)
|
||||
privileged.setup()
|
||||
self.enable()
|
||||
|
||||
def uninstall(self):
|
||||
"""De-configure and uninstall the app."""
|
||||
super().uninstall()
|
||||
privileged.uninstall()
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
"""Configure OpenVPN server."""
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
import augeas
|
||||
@ -222,3 +223,9 @@ def load_augeas():
|
||||
aug.set('/augeas/load/Simplevars/incl[last() + 1]', ATTR_FILE)
|
||||
aug.load()
|
||||
return aug
|
||||
|
||||
|
||||
@privileged
|
||||
def uninstall():
|
||||
"""Remove configuration directory for OpenVPN."""
|
||||
shutil.rmtree('/etc/openvpn', ignore_errors=True)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user