From 00683762c8612b5e89156b53db936f9557b0fc04 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 10 Sep 2020 21:45:28 -0700 Subject: [PATCH] coturn: Don't handle certificates if not installed Tests: - Without these changes, with Coturn not-installed, change the domain name. Notice that certificate events for Coturn fails due to missing domain information. - With these changes, with Coturn not-installed, change the domain name. Notice that certificate events for Coturn don't result in any actions. - With these changes, when Coturn is installed, certificate is properly setup for a domain. - With these changes, with Coturn installed, change the domain name. Notice that certificate events for Coturn succeed. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/coturn/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plinth/modules/coturn/__init__.py b/plinth/modules/coturn/__init__.py index 4138dff5e..5e74ee7e0 100644 --- a/plinth/modules/coturn/__init__.py +++ b/plinth/modules/coturn/__init__.py @@ -115,8 +115,8 @@ def get_domain(): def get_domains(): """Return a list with the configured domains.""" - setup_helper = globals()['setup_helper'] - if setup_helper.get_state() == 'needs-setup': + # If not installed, return empty. But work while installing too. + if not pathlib.Path('/etc/coturn/freedombox.conf').exists(): return [] domain = get_domain()