[tor-commits] [chutney/master] Better error if generating fingerprint fails

nickm at torproject.org nickm at torproject.org
Mon Dec 15 17:38:13 UTC 2014


commit 85f54fdc62a6c7a2c095aa1b0505aad02227697f
Author: Nick Mathewson <nickm at torproject.org>
Date:   Mon Dec 15 12:38:08 2014 -0500

    Better error if generating fingerprint fails
---
 lib/chutney/TorNet.py |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index 7e64035..37872ed 100644
--- a/lib/chutney/TorNet.py
+++ b/lib/chutney/TorNet.py
@@ -395,7 +395,10 @@ class LocalNodeBuilder(NodeBuilder):
                 raise
         stdout, stderr = p.communicate()
         fingerprint = "".join(stdout.split()[1:])
-        assert re.match(r'^[A-F0-9]{40}$', fingerprint)
+        if not re.match(r'^[A-F0-9]{40}$', fingerprint):
+            print (("Error when calling %r. It gave %r as a fingerprint "
+                    " and %r on stderr.")%(" ".join(cmdline), stdout, stderr))
+            sys.exit(1)
         self._env['fingerprint'] = fingerprint
 
     def _getAltAuthLines(self, hasbridgeauth=False):



More information about the tor-commits mailing list