[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit bd76a94b69c46e566c6d0517dd7b829f04191c6a
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
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)



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits