coturn: Completely uninstall app

Tests:

* Verify from the UI that after reinstalling the app a new secret is generated
* Functional tests passed

Signed-off-by: nbenedek <contact@nbenedek.me>
[sunil: Update docstrings, make uninstall fail-safe]
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-03 22:33:41 +02:00 committed by Sunil Mohan Adapa
parent 3d71869211
commit db2d42c5ac
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 11 additions and 0 deletions

View File

@ -114,6 +114,11 @@ class CoturnApp(app_module.App):
self.get_component('letsencrypt-coturn').setup_certificates()
notify_configuration_change()
def uninstall(self):
"""De-configure and uninstall the app."""
super().uninstall()
privileged.uninstall()
def get_available_domains():
"""Return an iterator with all domains able to have a certificate."""

View File

@ -89,3 +89,9 @@ def augeas_load():
aug.load()
return aug
@privileged
def uninstall():
"""Remove configuration file."""
CONFIG_FILE.unlink(missing_ok=True)