From 9b9238188a32b7c9350f1db0b7e89c0de043a36d Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 10 Sep 2020 17:29:46 -0700 Subject: [PATCH] pagekite: Don't update names module if not installed - Due to a minor regression with init() method refactoring: - Pagekite tries to check if it is enabled even when it is not installed. This is an unnecessary check. - Pagekite tries to remove domains from name services even when it is not installed. This could have unnecessary consequences. Fix this by checking if Pagekite is installed and perform name services updating only if service is enabled. Tests: - Enable pagekite and configure it. When FreedomBox is restarted, Pagekite kite is announced as domain and shown in Name Services. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/pagekite/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plinth/modules/pagekite/__init__.py b/plinth/modules/pagekite/__init__.py index eff0ab899..3a305ed76 100644 --- a/plinth/modules/pagekite/__init__.py +++ b/plinth/modules/pagekite/__init__.py @@ -81,7 +81,9 @@ class PagekiteApp(app_module.App): self.add(daemon) # Register kite name with Name Services module. - utils.update_names_module(is_enabled=self.is_enabled()) + setup_helper = globals()['setup_helper'] + if setup_helper.get_state() != 'needs-setup' and self.is_enabled(): + utils.update_names_module(is_enabled=True) def enable(self): """Send domain signals after enabling the app."""