[tahoe-lafs-trac-stream] [Tahoe-LAFS] #3242: Pass the full Tahoe-LAFS configuration to IFoolscapStoragePlugin methods
Tahoe-LAFS
trac at tahoe-lafs.org
Fri Aug 16 19:21:35 UTC 2019
#3242: Pass the full Tahoe-LAFS configuration to IFoolscapStoragePlugin methods
---------------------+-------------------------------------------
Reporter: exarkun | Owner:
Type: defect | Status: new
Priority: normal | Milestone: storage economics plugins
Component: unknown | Version: n/a
Keywords: | Launchpad Bug:
---------------------+-------------------------------------------
IFoolscapStoragePlugin methods are defined as taking a dict containing
only the part of tahoe.cfg that is specifically for them. That is, the
server method gets the contents of the `[storage.plugins.<plugin name>]`
section and the client methods get the `[storageclient.plugins.<plugin
name>]` section.
This was done to try to keep the values access as limited as possible.
All else being equal, fewer things is better than more things.
However, it seems clear now that this is too limited. For example, a
plugin can't even find the node directory with this little information.
If a plugin wants to keep some state with the node, it has no way to know
where that should be.
The `_Config` object is much more useful and provides helpful abstractions
that we would like to encourage to be used in Python code - for example,
`write_private_config` instead of finding out the node directory,
constructing a path to a file in the private directory, and then directly
performing I/O on that file.
So, instead of passing only the plugin's config section, pass a `_Config`
instance.
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3242>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list