[tor-commits] [chutney/master] TorNet: Split out print_bootstrap_status()
teor at torproject.org
teor at torproject.org
Fri Mar 13 01:11:26 UTC 2020
commit cd1ad673299d27f891e34a94c6324459a5e1324e
Author: teor <teor at torproject.org>
Date: Wed Feb 19 15:52:07 2020 +1000
TorNet: Split out print_bootstrap_status()
Split print_bootstrap_status() out into its own function.
Part of 33232.
---
lib/chutney/TorNet.py | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index 0917fbf..3fa94ac 100644
--- a/lib/chutney/TorNet.py
+++ b/lib/chutney/TorNet.py
@@ -1448,6 +1448,12 @@ class Network(object):
print("Sending SIGHUP to nodes")
return all([n.getController().hup() for n in self._nodes])
+ def print_bootstrap_status(self, controllers, most_recent_status):
+ print("Bootstrap failed. Node status:")
+ for c, status in zip(controllers,most_recent_status):
+ c.check(listRunning=False, listNonRunning=True)
+ print("{}: {}".format(c.getNick(), status))
+
CHECK_NETWORK_STATUS_DELAY = 0.5
def wait_for_bootstrap(self):
@@ -1475,11 +1481,7 @@ class Network(object):
break
time.sleep(Network.CHECK_NETWORK_STATUS_DELAY)
- print("Bootstrap failed. Node status:")
- for c, status in zip(controllers,most_recent_status):
- c.check(listRunning=False, listNonRunning=True)
- print("{}: {}".format(c.getNick(), status))
-
+ self.print_bootstrap_status(controllers, most_recent_status)
return False
def stop(self):
More information about the tor-commits
mailing list