From 246e0730925262b894286fe922d6050ecdea18be Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Sun, 19 Jan 2025 11:34:57 +0300 Subject: [PATCH] Update subscription pattern in check_logs function of checker.py to improve error message handling. Enhanced regex to capture error types more accurately, ensuring whitespace is stripped from error messages. This change refines log analysis and improves clarity in health check reporting. --- checker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/checker.py b/checker.py index 9e365f0..8b15309 100644 --- a/checker.py +++ b/checker.py @@ -138,7 +138,7 @@ def check_logs(log_handler): except subprocess.CalledProcessError as e: raise RuntimeError(f"Error running docker logs: {e}") - subscription_pattern = r'Ignored subscription creation.*id=(\d+).*err=([^\s]+)' + subscription_pattern = r'\[info\s*\].*Ignored subscription creation.*id=(\d+).*err=(.+?)(?=\s+\[|$)' matches = list(re.finditer(subscription_pattern, log_content)) if not matches: @@ -147,7 +147,7 @@ def check_logs(log_handler): last_match = matches[-1] last_id = last_match.group(1) - error_type = last_match.group(2) + error_type = last_match.group(2).strip() if error_type == "Container-set not supported": status = f"Container error (id: {last_id})"