mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-19 13:07:56 +00:00
Log 'something' when we fail to instantiate a client
This commit is contained in:
parent
be2c6b09f3
commit
928e61bf22
1
newsfragments/3899.bugfix
Normal file
1
newsfragments/3899.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Print a useful message when a storage-client cannot be matched to configuration
|
@ -667,6 +667,9 @@ def _storage_from_foolscap_plugin(node_config, config, announcement, get_rref):
|
|||||||
|
|
||||||
:param allmydata.node._Config node_config: The node configuration to
|
:param allmydata.node._Config node_config: The node configuration to
|
||||||
pass to the plugin.
|
pass to the plugin.
|
||||||
|
|
||||||
|
:param dict announcement: The storage announcement for the storage
|
||||||
|
server we should build
|
||||||
"""
|
"""
|
||||||
plugins = {
|
plugins = {
|
||||||
plugin.name: plugin
|
plugin.name: plugin
|
||||||
@ -687,7 +690,8 @@ def _storage_from_foolscap_plugin(node_config, config, announcement, get_rref):
|
|||||||
option,
|
option,
|
||||||
get_rref,
|
get_rref,
|
||||||
)
|
)
|
||||||
raise AnnouncementNotMatched()
|
plugin_names = ", ".join(sorted(list(config.storage_plugins.keys())))
|
||||||
|
raise AnnouncementNotMatched(plugin_names)
|
||||||
|
|
||||||
|
|
||||||
@implementer(IServer)
|
@implementer(IServer)
|
||||||
@ -761,9 +765,8 @@ class NativeStorageServer(service.MultiService):
|
|||||||
# able to get the most up-to-date value.
|
# able to get the most up-to-date value.
|
||||||
self.get_rref,
|
self.get_rref,
|
||||||
)
|
)
|
||||||
except AnnouncementNotMatched:
|
except AnnouncementNotMatched as e:
|
||||||
# Nope.
|
print('No plugin for storage-server "{nickname}" from plugins: {plugins}'.format(nickname=ann.get("nickname", "<unknown>"), plugins=e.args[0]))
|
||||||
pass
|
|
||||||
else:
|
else:
|
||||||
return _FoolscapStorage.from_announcement(
|
return _FoolscapStorage.from_announcement(
|
||||||
self._server_id,
|
self._server_id,
|
||||||
|
Loading…
Reference in New Issue
Block a user