From e0333677304a66429cafa6ecac3037372f9842f9 Mon Sep 17 00:00:00 2001 From: Justin Stephenson Date: Mon, 18 Nov 2024 15:15:41 -0500 Subject: [PATCH] analyzer: fix two crashes OSError from 'sss_analyze error list' PermissionError from 'sss_analyze request list' run without sudo --- src/tools/analyzer/source_files.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/tools/analyzer/source_files.py b/src/tools/analyzer/source_files.py index 0cadf99f035..1825d2d7c97 100644 --- a/src/tools/analyzer/source_files.py +++ b/src/tools/analyzer/source_files.py @@ -31,9 +31,8 @@ def __iter__(self): with open(files) as file: for line in file: yield line - except FileNotFoundError as err: - logger.warning("Could not find domain log file, skipping") - logger.warning(err) + except Exception as e: + logger.warning(e) continue def resolve_path(self, path): @@ -70,7 +69,6 @@ def set_component(self, component, child): elif component == self.Component.BE: domains = self.get_domain_logfiles(child) if not domains: - raise IOError - # error: No domains found? + return for dom in domains: self.log_files.append(dom)