[tor-commits] [chutney/master] wait_for_bootstrap: Fix the regex for bootstrap messages

teor at torproject.org teor at torproject.org
Tue Mar 19 05:09:50 UTC 2019


commit bd76a94b69c46e566c6d0517dd7b829f04191c6a
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed Mar 13 10:14:29 2019 -0400

    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.
---
 lib/chutney/TorNet.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index 4415907..e22afea 100644
--- a/lib/chutney/TorNet.py
+++ b/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)





More information about the tor-commits mailing list