From 468875b5589b3d8d95e344771088c583337f4910 Mon Sep 17 00:00:00 2001 From: Petro Pikh Date: Tue, 22 Feb 2022 10:20:58 +0200 Subject: [PATCH] Fix LogAnalyzer to force load regular expressions from common files Signed-off-by: Petro Pikh --- tests/common/plugins/loganalyzer/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/common/plugins/loganalyzer/__init__.py b/tests/common/plugins/loganalyzer/__init__.py index 32015d16f7c..0cba715e02b 100644 --- a/tests/common/plugins/loganalyzer/__init__.py +++ b/tests/common/plugins/loganalyzer/__init__.py @@ -30,9 +30,6 @@ def analyzer_add_marker(analyzers, node=None, results=None): loganalyzer = analyzers[node.hostname] logging.info("Add start marker into DUT syslog for host {}".format(node.hostname)) marker = loganalyzer.init() - logging.info("Load config and analyze log for host {}".format(node.hostname)) - # Read existed common regular expressions located with legacy loganalyzer module - loganalyzer.load_common_config() results[node.hostname] = marker @@ -53,7 +50,9 @@ def loganalyzer(duthosts, request): analyzers = {} parallel_run(analyzer_logrotate, [], {}, duthosts, timeout=120) for duthost in duthosts: - analyzers[duthost.hostname] = LogAnalyzer(ansible_host=duthost, marker_prefix=request.node.name) + analyzer = LogAnalyzer(ansible_host=duthost, marker_prefix=request.node.name) + analyzer.load_common_config() + analyzers[duthost.hostname] = analyzer markers = parallel_run(analyzer_add_marker, [analyzers], {}, duthosts, timeout=120) yield analyzers