#3242 closed defect (fixed)
Pass the full Tahoe-LAFS configuration IFoolscapStoragePlugin.get_client_resource
Reported by: | exarkun | Owned by: | GitHub <noreply@…> |
---|---|---|---|
Priority: | normal | Milestone: | storage economics plugins |
Component: | unknown | Version: | n/a |
Keywords: | review-needed | Cc: | |
Launchpad Bug: |
Description
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.
Change History (5)
comment:1 Changed at 2019-08-19T15:20:32Z by exarkun
comment:2 Changed at 2019-08-19T15:36:01Z by exarkun
- Summary changed from Pass the full Tahoe-LAFS configuration to IFoolscapStoragePlugin methods to Pass the full Tahoe-LAFS configuration IFoolscapStoragePlugin.get_client_resource
comment:3 Changed at 2019-08-20T00:06:53Z by exarkun
- Keywords review-needed added
comment:4 Changed at 2019-10-01T18:28:30Z by exarkun
- Resolution set to fixed
- Status changed from new to closed
Merged into integration branch in https://github.com/tahoe-lafs/tahoe-lafs/commit/2c9e724996a278b20596d506b37fa45bc17ac996
comment:5 Changed at 2019-11-18T13:45:40Z by GitHub <noreply@…>
- Owner set to GitHub <noreply@…>
In 2c9e724/trunk:
To keep the changeset small, I'll do this a piece at a time. First, get_client_resource.