[tor-commits] [chutney/master] TorNet: Raise error if methods not implemented

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


commit 6b5dda7cc869b30b5056965a077e0fa1b12350b9
Author: c <c at chroniko.jp>
Date:   Sat Apr 18 10:25:32 2020 +0000

    TorNet: Raise error if methods not implemented
    
    In NodeController and NodeBuilder abstract base classes, make it clearer
    which methods to override and give runtime errors if these are called
    and not overriden.
---
 lib/chutney/TorNet.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/chutney/TorNet.py b/lib/chutney/TorNet.py
index b68b240..4a5a8bc 100644
--- a/lib/chutney/TorNet.py
+++ b/lib/chutney/TorNet.py
@@ -520,22 +520,27 @@ class NodeBuilder(_NodeCommon):
     def checkConfig(self, net):
         """Try to format our torrc; raise an exception if we can't.
         """
+        raise NotImplementedError()
 
     def preConfig(self, net):
         """Called on all nodes before any nodes configure: generates keys as
            needed.
         """
+        raise NotImplementedError()
 
     def config(self, net):
         """Called to configure a node: creates a torrc file for it."""
+        raise NotImplementedError()
 
     def postConfig(self, net):
         """Called on each nodes after all nodes configure."""
+        raise NotImplementedError()
 
 
     def isSupported(self, net):
         """Return true if this node appears to have everything it needs;
            false otherwise."""
+        raise NotImplementedError()
 
 
 class NodeController(_NodeCommon):
@@ -558,9 +563,11 @@ class NodeController(_NodeCommon):
     def start(self):
         """Try to start this node; return True if we succeeded or it was
            already running, False if we failed."""
+        raise NotImplementedError()
 
     def stop(self, sig=signal.SIGINT):
         """Try to stop this node by sending it the signal 'sig'."""
+        raise NotImplementedError()
 
 
 class LocalNodeBuilder(NodeBuilder):





More information about the tor-commits mailing list