From ff698f308de9dd89fca77de0736c847113bd0016 Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Fri, 5 Jan 2024 20:13:17 +0700 Subject: [PATCH] Fix search patterns in Python scripts. --- tools/forward-lookup-host.py | 2 +- tools/generate-graph.py | 2 +- tools/reverse-lookup-host.py | 2 +- tools/shortest-path-create-chain.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/forward-lookup-host.py b/tools/forward-lookup-host.py index c0f8f95..66ea963 100755 --- a/tools/forward-lookup-host.py +++ b/tools/forward-lookup-host.py @@ -37,7 +37,7 @@ def build_lookup_table(input_lines, ignore_dest_user): prev_dest_host = None - if ": " in line or "->[" not in line or not line[-1].isdigit(): + if ": " in line or "]->" not in line or not line[-1].isdigit(): continue pattern = re.compile(r"(\w+)@(\d+\.\d+\.\d+\.\d+)(\[[^\]]+\])->(?=(\w+)@(\d+\.\d+\.\d+\.\d+))") diff --git a/tools/generate-graph.py b/tools/generate-graph.py index ce962a3..2f77dad 100755 --- a/tools/generate-graph.py +++ b/tools/generate-graph.py @@ -19,7 +19,7 @@ def build_lookup_table(input_lines, ignore_dest_user): line = line.strip() line = re.sub(r"^\[?\d+\]?\s*", "", line) - if ": " in line or ">" not in line or not line[-2].isdigit() or not line[-1] == ')': + if ": " in line or "]->" not in line or not line[-2].isdigit() or not line[-1] == ')': continue pattern = re.compile(r"(\w+)@\(([\d\.:]+)\)(\[[^\]]+\])->(?=(\w+)@\(([\d\.:]+)\))") diff --git a/tools/reverse-lookup-host.py b/tools/reverse-lookup-host.py index f49b47d..cb6f2b4 100755 --- a/tools/reverse-lookup-host.py +++ b/tools/reverse-lookup-host.py @@ -37,7 +37,7 @@ def build_lookup_table(input_lines, ignore_dest_user): prev_dest_host = None - if ": " in line or ">" not in line or not line[-1].isdigit(): + if ": " in line or "]->" not in line or not line[-1].isdigit(): continue pattern = re.compile(r"(\w+)@(\d+\.\d+\.\d+\.\d+)(\[[^\]]+\])->(?=(\w+)@(\d+\.\d+\.\d+\.\d+))") diff --git a/tools/shortest-path-create-chain.py b/tools/shortest-path-create-chain.py index ecd4581..2b73393 100755 --- a/tools/shortest-path-create-chain.py +++ b/tools/shortest-path-create-chain.py @@ -46,7 +46,7 @@ def build_lookup_table(input_lines, ignore_dest_user): prev_dest_host = None - if ":" in line or ">" not in line or not line[-1].isdigit(): + if ": " in line or "]->" not in line or not line[-1].isdigit(): continue pattern = re.compile(r"(\w+)@(\d+\.\d+\.\d+\.\d+)(\[[^\]]+\])->(?=(\w+)@(\d+\.\d+\.\d+\.\d+))")