mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-24 07:06:41 +00:00
get rid of redundant 'introducer_clients' var
This commit is contained in:
parent
c84e50baf0
commit
e74d2a7d01
@ -233,7 +233,7 @@ def create_client_from_config(config, _client_factory=None):
|
||||
)
|
||||
control_tub = node.create_control_tub()
|
||||
|
||||
introducer_clients, introducer_furls = create_introducer_clients(config, main_tub)
|
||||
introducer_clients = create_introducer_clients(config, main_tub)
|
||||
storage_broker = create_storage_farm_broker(
|
||||
config, default_connection_handlers, foolscap_connection_handlers,
|
||||
tub_options, introducer_clients
|
||||
@ -246,7 +246,6 @@ def create_client_from_config(config, _client_factory=None):
|
||||
i2p_provider,
|
||||
tor_provider,
|
||||
introducer_clients,
|
||||
introducer_furls,
|
||||
storage_broker,
|
||||
tub_is_listening=is_listening,
|
||||
)
|
||||
@ -271,16 +270,10 @@ def _sequencer(config):
|
||||
|
||||
def create_introducer_clients(config, main_tub):
|
||||
"""
|
||||
returns a 2-tuple containing two lists: introducer_clients,
|
||||
introducer_furls
|
||||
:returns: a list of IntroducerClient instances
|
||||
"""
|
||||
# (probably makes sense to return a list of 2-tuples instead of a
|
||||
# 2-tuple of lists, but keeping variable names etc from when this
|
||||
# was self.init_introducer_clients in Node)
|
||||
|
||||
# Returns both of these:
|
||||
# we return this list
|
||||
introducer_clients = []
|
||||
introducer_furls = []
|
||||
|
||||
introducers_yaml_filename = config.get_private_path("introducers.yaml")
|
||||
introducers_filepath = FilePath(introducers_yaml_filename)
|
||||
@ -327,8 +320,8 @@ def create_introducer_clients(config, main_tub):
|
||||
introducer_cache_filepath,
|
||||
)
|
||||
introducer_clients.append(ic)
|
||||
introducer_furls.append(introducer['furl'])
|
||||
return introducer_clients, introducer_furls
|
||||
# introducer_furls.append(introducer['furl'])
|
||||
return introducer_clients
|
||||
|
||||
|
||||
def create_storage_farm_broker(config, default_connection_handlers, foolscap_connection_handlers, tub_options, introducer_clients):
|
||||
@ -380,7 +373,7 @@ class _Client(node.Node, pollmixin.PollMixin):
|
||||
"max_segment_size": 128*KiB,
|
||||
}
|
||||
|
||||
def __init__(self, config, main_tub, control_tub, i2p_provider, tor_provider, introducer_clients, introducer_furls,
|
||||
def __init__(self, config, main_tub, control_tub, i2p_provider, tor_provider, introducer_clients,
|
||||
storage_farm_broker, tub_is_listening):
|
||||
"""
|
||||
Use create_client() to instantiate one of these.
|
||||
@ -393,7 +386,6 @@ class _Client(node.Node, pollmixin.PollMixin):
|
||||
self.encoding_params = self.DEFAULT_ENCODING_PARAMETERS.copy()
|
||||
|
||||
self.introducer_clients = introducer_clients
|
||||
self.introducer_furls = introducer_furls # appears completely unused (but for tests?)
|
||||
self.storage_broker = storage_farm_broker
|
||||
|
||||
self.init_stats_provider()
|
||||
|
@ -200,7 +200,6 @@ def create_no_network_client(basedir):
|
||||
i2p_provider=None,
|
||||
tor_provider=None,
|
||||
introducer_clients=[],
|
||||
introducer_furls=[],
|
||||
storage_farm_broker=storage_broker,
|
||||
tub_is_listening=True,
|
||||
)
|
||||
|
@ -83,7 +83,7 @@ class MultiIntroTests(unittest.TestCase):
|
||||
|
||||
# get a client and first introducer_furl
|
||||
myclient = yield create_client(self.basedir)
|
||||
tahoe_cfg_furl = myclient.introducer_furls[0]
|
||||
tahoe_cfg_furl = myclient.introducer_clients[0].introducer_furl
|
||||
|
||||
# assertions
|
||||
self.failUnlessEqual(fake_furl, tahoe_cfg_furl)
|
||||
@ -142,14 +142,14 @@ class NoDefault(unittest.TestCase):
|
||||
}}
|
||||
self.yaml_path.setContent(yamlutil.safe_dump(connections))
|
||||
myclient = yield create_client(self.basedir)
|
||||
tahoe_cfg_furl = myclient.introducer_furls[0]
|
||||
tahoe_cfg_furl = myclient.introducer_clients[0].introducer_furl
|
||||
self.assertEquals(tahoe_cfg_furl, 'furl1')
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def test_real_yaml(self):
|
||||
self.yaml_path.setContent(SIMPLE_YAML)
|
||||
myclient = yield create_client(self.basedir)
|
||||
tahoe_cfg_furl = myclient.introducer_furls[0]
|
||||
tahoe_cfg_furl = myclient.introducer_clients[0].introducer_furl
|
||||
self.assertEquals(tahoe_cfg_furl, 'furl1')
|
||||
|
||||
@defer.inlineCallbacks
|
||||
@ -167,7 +167,7 @@ class NoDefault(unittest.TestCase):
|
||||
connections = {'introducers': {} }
|
||||
self.yaml_path.setContent(yamlutil.safe_dump(connections))
|
||||
myclient = yield create_client(self.basedir)
|
||||
self.assertEquals(len(myclient.introducer_furls), 0)
|
||||
self.assertEquals(len(myclient.introducer_clients), 0)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
Loading…
Reference in New Issue
Block a user