commit 287c61a4c055f76b00d52c370c5a30948bd936e5 Author: Nick Mathewson nickm@torproject.org Date: Wed Mar 13 10:25:47 2019 -0400
wait_for_bootstrap: another regex tweak
This tweak makes us capture _only_ the status keyword, rather than the keyword plus its surrounding parentheses and space. --- lib/chutney/TorNet.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py index 3e8b94e..4aec528 100644 --- a/lib/chutney/TorNet.py +++ b/lib/chutney/TorNet.py @@ -841,7 +841,8 @@ class LocalNodeController(NodeController): percent,keyword,message=-100,"no_message","No bootstrap messages yet." with open(logfname, 'r') as f: for line in f: - m = re.search(r'Bootstrapped (\d+)%( ([^)]*))?: (.*)', line) + m = re.search(r'Bootstrapped (\d+)%(?: (([^)]*)))?: (.*)', + line) if m: percent, keyword, message = m.groups() percent = int(percent)