From 5bebfddc3359f65337927f3199f14c34982304b8 Mon Sep 17 00:00:00 2001 From: mkadilov Date: Wed, 6 Dec 2023 17:58:06 +0300 Subject: [PATCH] [OBJECT-138] Executive command changed Added exception of error 'Too many requests' in log analyzer and fixed arguments ordr in get_filtered_logs Signed-off-by: Mikhail Kadilov m.kadilov@yadro.com --- src/frostfs_testlib/hosting/docker_host.py | 5 +++++ src/frostfs_testlib/hosting/interfaces.py | 1 + 2 files changed, 6 insertions(+) diff --git a/src/frostfs_testlib/hosting/docker_host.py b/src/frostfs_testlib/hosting/docker_host.py index 0e4ea11..6b86529 100644 --- a/src/frostfs_testlib/hosting/docker_host.py +++ b/src/frostfs_testlib/hosting/docker_host.py @@ -235,6 +235,7 @@ class DockerHost(Host): since: Optional[datetime] = None, until: Optional[datetime] = None, unit: Optional[str] = None, + exclude_filter: Optional[str] = None, ) -> str: client = self._get_docker_client() filtered_logs = "" @@ -248,6 +249,10 @@ class DockerHost(Host): matches = re.findall(filter_regex, filtered_logs, re.IGNORECASE + re.MULTILINE) found = list(matches) + + if exclude_filter: + found = [match for match in found if match != exclude_filter] + if found: filtered_logs += f"{container_name}:\n{os.linesep.join(found)}" diff --git a/src/frostfs_testlib/hosting/interfaces.py b/src/frostfs_testlib/hosting/interfaces.py index 84b7911..9dd6f3c 100644 --- a/src/frostfs_testlib/hosting/interfaces.py +++ b/src/frostfs_testlib/hosting/interfaces.py @@ -287,6 +287,7 @@ class Host(ABC): since: Optional[datetime] = None, until: Optional[datetime] = None, unit: Optional[str] = None, + exclude_filter: Optional[str] = None, ) -> str: """Get logs from host filtered by regex.