Skip to content

Commit

Permalink
Fix regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Unisikhin committed Dec 5, 2024
1 parent 164054b commit ea9f30f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 495 deletions.
6 changes: 3 additions & 3 deletions ch_tools/monrun_checks/ch_orphaned_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from ch_tools.chadmin.internal.zookeeper import get_zk_node
from ch_tools.common.result import CRIT, OK, WARNING, Result

ERROR_MESSAGE_PATTERN = r"(Code:\s\d+\.\sDB::Exception:\s).*(\s\([A-Z_]*\)\s\(version\s.*\s\(official build\)\)).*"
ERROR_MESSAGE_PATTERN = r"(Code:\s\d+\.\sDB::Exception:\s)(.*)(\s\([A-Z_]*\)\s\(version\s.*\s\(official build\)\))(.*)"


@click.command("orphaned-objects")
Expand Down Expand Up @@ -107,5 +107,5 @@ def _zk_get_orphaned_objects_state(


def _error_message_format(error_msg: str) -> str:
error_msg = re.sub(ERROR_MESSAGE_PATTERN, r"\1...\2", error_msg)
return error_msg
error_msg = re.sub(ERROR_MESSAGE_PATTERN, r"\1...\3...", error_msg)
return error_msg
Loading

0 comments on commit ea9f30f

Please sign in to comment.