diff --git a/src/allmydata/client.py b/src/allmydata/client.py index 8e9f8f9e8..ed65917ed 100644 --- a/src/allmydata/client.py +++ b/src/allmydata/client.py @@ -465,17 +465,16 @@ def create_introducer_clients(config, main_tub, _introducer_factory=None): introducers = config.get_introducer_configuration() - for petname, introducer_furl in introducers.items(): - introducer_cache_filepath = FilePath(config.get_private_path("introducer_{}_cache.yaml".format(petname))) + for petname, (furl, cache_path) in introducers.items(): ic = _introducer_factory( main_tub, - introducer_furl.encode("ascii"), + furl.encode("ascii"), config.nickname, str(allmydata.__full_version__), str(_Client.OLDEST_SUPPORTED_VERSION), list(node.get_app_versions()), partial(_sequencer, config), - introducer_cache_filepath, + cache_path, ) introducer_clients.append(ic) return introducer_clients diff --git a/src/allmydata/node.py b/src/allmydata/node.py index 7dc579a83..7b8c5d65a 100644 --- a/src/allmydata/node.py +++ b/src/allmydata/node.py @@ -438,12 +438,17 @@ class _Config(object): """ Get configuration for introducers. - :return {unicode: unicode}: A mapping from introducer petname to the - introducer's fURL. + :return {unicode: (unicode, FilePath)}: A mapping from introducer + petname to a tuple of the introducer's fURL and local cache path. """ introducers_yaml_filename = self.get_private_path("introducers.yaml") introducers_filepath = FilePath(introducers_yaml_filename) + def get_cache_filepath(petname): + return FilePath( + self.get_private_path("introducer_{}_cache.yaml".format(petname)), + ) + try: with introducers_filepath.open() as f: introducers_yaml = safe_load(f) @@ -491,7 +496,11 @@ class _Config(object): ) introducers['default'] = tahoe_cfg_introducer_furl - return introducers + return { + petname: (furl, get_cache_filepath(petname)) + for (petname, furl) + in introducers.items() + } def create_tub_options(config):