From 9ec0c5f3db60c126019efd828c49b8947f88541f Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 16 Nov 2021 16:35:23 -0800 Subject: [PATCH] security: Drop use of managed_services in security report Use Daemon component instead. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/security/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plinth/modules/security/__init__.py b/plinth/modules/security/__init__.py index 55b02acf8..88c1aca8e 100644 --- a/plinth/modules/security/__init__.py +++ b/plinth/modules/security/__init__.py @@ -12,6 +12,7 @@ from django.utils.translation import gettext_lazy as _ from plinth import actions from plinth import app as app_module from plinth import menu, module_loader +from plinth.daemon import Daemon from plinth.modules.backups.components import BackupRestore from plinth.package import Packages @@ -137,10 +138,10 @@ def get_apps_report(): if not packages: continue # app has no managed packages - try: - services = module.managed_services - except AttributeError: - services = None + components = module.app.get_components_of_type(Daemon) + services = [] + for component in components: + services.append(component.unit) # filter out apps not setup yet if module.setup_helper.get_state() == 'needs-setup':