[tor-commits] [chutney/master] TorNet: make commandline invocations clear

nickm at torproject.org nickm at torproject.org
Mon May 18 00:07:49 UTC 2020


commit 2f0e34e465b929d3d592afca6c38f2dcc8b81a1e
Author: c <c at chroniko.jp>
Date:   Sun May 17 01:17:53 2020 +0000

    TorNet: make commandline invocations clear
    
    Analysis tools such as vulture treat functions configure, restart, and
    wait_for_bootstrap in Network as unused, when in reality they are called
    from the ./chutney commandline. Make this explicitly clear.
---
 lib/chutney/TorNet.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index b5f238a..cd9a9ec 100644
--- a/lib/chutney/TorNet.py
+++ b/lib/chutney/TorNet.py
@@ -2112,6 +2112,9 @@ class Network(object):
             sys.exit(1)
 
     def configure(self):
+        """Invoked from command line: Configure and prepare the network to be
+           started.
+        """
         phase = self._dfltEnv['CUR_CONFIG_PHASE']
         if phase == 1:
             self.create_new_nodes_dir()
@@ -2152,7 +2155,9 @@ class Network(object):
         return n_ok == len(self._nodes)
 
     def restart(self):
-        """Stop and subsequently start our network's nodes."""
+        """Invoked from command line: Stop and subsequently start our
+           network's nodes.
+        """
         self.stop()
         self.start()
 
@@ -2247,6 +2252,9 @@ class Network(object):
     CHECKS_PER_PRINT = PRINT_NETWORK_STATUS_DELAY / CHECK_NETWORK_STATUS_DELAY
 
     def wait_for_bootstrap(self):
+        """Invoked from tools/test-network.sh to wait for the network to
+           bootstrap.
+        """
         print("Waiting for nodes to bootstrap...\n")
         start = time.time()
         limit = start + getenv_int("CHUTNEY_START_TIME", 60)





More information about the tor-commits mailing list