Browse Source

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.
Nick Mathewson 5 years ago
parent
commit
287c61a4c0
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lib/chutney/TorNet.py

+ 2 - 1
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)