Browse Source

wait_for_bootstrap: Fix the regex for bootstrap messages

The regex was almost right, but it required a space after the
percent symbol. In reality, this space should only be there when
there is a keyword following.

Part of 22132.
Nick Mathewson 5 years ago
parent
commit
bd76a94b69
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/chutney/TorNet.py

+ 1 - 1
lib/chutney/TorNet.py

@@ -837,7 +837,7 @@ 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)