From 0611af6b0b7de30ef9720ab08b796f615107f5bf Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 15 Oct 2021 13:10:18 -0400 Subject: [PATCH] Stop passing even a dummy value for control tub into Nodes --- src/allmydata/client.py | 6 ++---- src/allmydata/introducer/server.py | 6 ++---- src/allmydata/node.py | 2 +- src/allmydata/test/no_network.py | 1 - src/allmydata/test/web/test_introducer.py | 2 +- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/allmydata/client.py b/src/allmydata/client.py index 8a953937a..a2f88ebd6 100644 --- a/src/allmydata/client.py +++ b/src/allmydata/client.py @@ -282,7 +282,6 @@ def create_client_from_config(config, _client_factory=None, _introducer_factory= config, tub_options, default_connection_handlers, foolscap_connection_handlers, i2p_provider, tor_provider, ) - control_tub = None introducer_clients = create_introducer_clients(config, main_tub, _introducer_factory) storage_broker = create_storage_farm_broker( @@ -293,7 +292,6 @@ def create_client_from_config(config, _client_factory=None, _introducer_factory= client = _client_factory( config, main_tub, - control_tub, i2p_provider, tor_provider, introducer_clients, @@ -630,12 +628,12 @@ class _Client(node.Node, pollmixin.PollMixin): "max_segment_size": DEFAULT_MAX_SEGMENT_SIZE, } - def __init__(self, config, main_tub, control_tub, i2p_provider, tor_provider, introducer_clients, + def __init__(self, config, main_tub, i2p_provider, tor_provider, introducer_clients, storage_farm_broker): """ Use :func:`allmydata.client.create_client` to instantiate one of these. """ - node.Node.__init__(self, config, main_tub, control_tub, i2p_provider, tor_provider) + node.Node.__init__(self, config, main_tub, i2p_provider, tor_provider) self.started_timestamp = time.time() self.logSource = "Client" diff --git a/src/allmydata/introducer/server.py b/src/allmydata/introducer/server.py index 950602f98..8678ad5bf 100644 --- a/src/allmydata/introducer/server.py +++ b/src/allmydata/introducer/server.py @@ -87,12 +87,10 @@ def create_introducer(basedir=u"."): config, tub_options, default_connection_handlers, foolscap_connection_handlers, i2p_provider, tor_provider, ) - control_tub = None node = _IntroducerNode( config, main_tub, - control_tub, i2p_provider, tor_provider, ) @@ -104,8 +102,8 @@ def create_introducer(basedir=u"."): class _IntroducerNode(node.Node): NODETYPE = "introducer" - def __init__(self, config, main_tub, control_tub, i2p_provider, tor_provider): - node.Node.__init__(self, config, main_tub, control_tub, i2p_provider, tor_provider) + def __init__(self, config, main_tub, i2p_provider, tor_provider): + node.Node.__init__(self, config, main_tub, i2p_provider, tor_provider) self.init_introducer() webport = self.get_config("node", "web.port", None) if webport: diff --git a/src/allmydata/node.py b/src/allmydata/node.py index 08271fc5f..3ac4c507b 100644 --- a/src/allmydata/node.py +++ b/src/allmydata/node.py @@ -926,7 +926,7 @@ class Node(service.MultiService): NODETYPE = "unknown NODETYPE" CERTFILE = "node.pem" - def __init__(self, config, main_tub, control_tub, i2p_provider, tor_provider): + def __init__(self, config, main_tub, i2p_provider, tor_provider): """ Initialize the node with the given configuration. Its base directory is the current directory by default. diff --git a/src/allmydata/test/no_network.py b/src/allmydata/test/no_network.py index 3b88a1cc6..7a84580bf 100644 --- a/src/allmydata/test/no_network.py +++ b/src/allmydata/test/no_network.py @@ -250,7 +250,6 @@ def create_no_network_client(basedir): client = _NoNetworkClient( config, main_tub=None, - control_tub=None, i2p_provider=None, tor_provider=None, introducer_clients=[], diff --git a/src/allmydata/test/web/test_introducer.py b/src/allmydata/test/web/test_introducer.py index ba0a5beb9..4b5850cbc 100644 --- a/src/allmydata/test/web/test_introducer.py +++ b/src/allmydata/test/web/test_introducer.py @@ -211,7 +211,7 @@ class IntroducerRootTests(SyncTestCase): main_tub = Tub() main_tub.listenOn(b"tcp:0") main_tub.setLocation(b"tcp:127.0.0.1:1") - introducer_node = _IntroducerNode(config, main_tub, None, None, None) + introducer_node = _IntroducerNode(config, main_tub, None, None) introducer_service = introducer_node.getServiceNamed("introducer") for n in range(2):