create a StorageClientConfig object

Make it easier to pass more storage configuration down into StorageFarmBroker
and beyond
This commit is contained in:
Jean-Paul Calderone
2019-06-28 14:24:58 -04:00
parent 6e3cd2d91c
commit b5a2c70a4a
2 changed files with 29 additions and 5 deletions

View File

@ -536,8 +536,9 @@ def create_storage_farm_broker(config, default_connection_handlers, foolscap_con
:param list introducer_clients: IntroducerClient instances if
we're connecting to any
"""
ps = config.get_config("client", "peers.preferred", "").split(",")
preferred_peers = tuple([p.strip() for p in ps if p != ""])
storage_client_config = storage_client.StorageClientConfig.from_node_config(
config,
)
def tub_creator(handler_overrides=None, **kwargs):
return node.create_tub(
@ -551,7 +552,7 @@ def create_storage_farm_broker(config, default_connection_handlers, foolscap_con
sb = storage_client.StorageFarmBroker(
permute_peers=True,
tub_maker=tub_creator,
preferred_peers=preferred_peers,
storage_client_config=storage_client_config,
)
for ic in introducer_clients:
sb.use_introducer(ic)