From 0a10ced950860034ac015f33413d27db25b81a6e Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 1 Oct 2024 22:33:53 -0700 Subject: [PATCH] names: Perform resolve diagnostics only if resolved is installed Tests: - Ensure that systemd-resolved is not installed. Run diagnostics on names app. There should be no diagnostic related to resolving address for deb.debian.org. - Ensure that systemd-resolved is installed. Run diagnostics on names app. There should be diagnostic related to resolving address for deb.debian.org. Signed-off-by: Sunil Mohan Adapa Reviewed-by: Veiko Aasa --- plinth/modules/names/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plinth/modules/names/__init__.py b/plinth/modules/names/__init__.py index de48e4633..1855481dd 100644 --- a/plinth/modules/names/__init__.py +++ b/plinth/modules/names/__init__.py @@ -93,7 +93,9 @@ class NamesApp(app_module.App): def diagnose(self) -> list[DiagnosticCheck]: """Run diagnostics and return the results.""" results = super().diagnose() - results.append(diagnose_resolution('deb.debian.org')) + if is_resolved_installed(): + results.append(diagnose_resolution('deb.debian.org')) + return results def setup(self, old_version):