Skip to content

Commit 8dd5a3b

Browse files
authored
Merge pull request #2744 from ueqri/enhance-vtr-flow-log-parser
[TestScript] Enhanced the Robustness of the VTR Flow Log Parser Script
2 parents e54189d + ee29e88 commit 8dd5a3b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

vtr_flow/scripts/python_libs/vtr/log_parse.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ class ParsePattern:
2323
def __init__(self, name, filename, regex_str, default_value=None):
2424
self._name = name
2525
self._filename = filename
26-
self._regex = re.compile(regex_str)
26+
# Look for the specified pattern somewhere in the line, but any characters
27+
# can occur before and after it. Detailed in GitHub Issue #2743.
28+
self._regex = re.compile(f'^.*{regex_str}.*$')
2729
self._default_value = default_value
2830

2931
def name(self):

vtr_flow/scripts/python_libs/vtr/parse_vtr_flow.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ def parse_file_and_update_results(filename, patterns, results):
3636

3737
with open(filepaths[0], "r") as file:
3838
for line in file:
39-
while line[0] == "#":
40-
line = line[1:]
41-
4239
for parse_pattern in patterns:
4340
match = parse_pattern.regex().match(line)
4441
if match and match.groups():

0 commit comments

Comments
 (0)