]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commit
Overhaul IFilesystemNode handling, to simplify tests and use POLA internally.
authorBrian Warner <warner@lothar.com>
Sat, 15 Aug 2009 11:02:56 +0000 (04:02 -0700)
committerBrian Warner <warner@lothar.com>
Sat, 15 Aug 2009 11:28:46 +0000 (04:28 -0700)
commit0d5dc5161791a90a7ce2df285041bb2dd77c8061
tree952fc86e14a6d4a6c3c9e8d4e8e50b0a395371a1
parentffd5135fed7e35722b8f4acf4150a1ecddc2c9c3
Overhaul IFilesystemNode handling, to simplify tests and use POLA internally.

* stop using IURI as an adapter
* pass cap strings around instead of URI instances
* move filenode/dirnode creation duties from Client to new NodeMaker class
* move other Client duties to KeyGenerator, SecretHolder, History classes
* stop passing Client reference to dirnode/filenode constructors
  - pass less-powerful references instead, like StorageBroker or Uploader
* always create DirectoryNodes by wrapping a filenode (mutable for now)
* remove some specialized mock classes from unit tests

Detailed list of changes (done one at a time, then merged together)

always pass a string to create_node_from_uri(), not an IURI instance
always pass a string to IFilesystemNode constructors, not an IURI instance
stop using IURI() as an adapter, switch on cap prefix in create_node_from_uri()
client.py: move SecretHolder code out to a separate class
test_web.py: hush pyflakes
client.py: move NodeMaker functionality out into a separate object
LiteralFileNode: stop storing a Client reference
immutable Checker: remove Client reference, it only needs a SecretHolder
immutable Upload: remove Client reference, leave SecretHolder and StorageBroker
immutable Repairer: replace Client reference with StorageBroker and SecretHolder
immutable FileNode: remove Client reference
mutable.Publish: stop passing Client
mutable.ServermapUpdater: get StorageBroker in constructor, not by peeking into Client reference
MutableChecker: reference StorageBroker and History directly, not through Client
mutable.FileNode: removed unused indirection to checker classes
mutable.FileNode: remove Client reference
client.py: move RSA key generation into a separate class, so it can be passed to the nodemaker
move create_mutable_file() into NodeMaker
test_dirnode.py: stop using FakeClient mockups, use NoNetworkGrid instead. This simplifies the code, but takes longer to run (17s instead of 6s). This should come down later when other cleanups make it possible to use simpler (non-RSA) fake mutable files for dirnode tests.
test_mutable.py: clean up basedir names
client.py: move create_empty_dirnode() into NodeMaker
dirnode.py: get rid of DirectoryNode.create
remove DirectoryNode.init_from_uri, refactor NodeMaker for customization, simplify test_web's mock Client to match
stop passing Client to DirectoryNode, make DirectoryNode.create_with_mutablefile the normal DirectoryNode constructor, start removing client from NodeMaker
remove Client from NodeMaker
move helper status into History, pass History to web.Status instead of Client
test_mutable.py: fix minor typo
29 files changed:
src/allmydata/client.py
src/allmydata/dirnode.py
src/allmydata/history.py
src/allmydata/immutable/checker.py
src/allmydata/immutable/filenode.py
src/allmydata/immutable/offloaded.py
src/allmydata/immutable/repairer.py
src/allmydata/immutable/upload.py
src/allmydata/interfaces.py
src/allmydata/mutable/checker.py
src/allmydata/mutable/filenode.py
src/allmydata/mutable/publish.py
src/allmydata/mutable/servermap.py
src/allmydata/nodemaker.py [new file with mode: 0755]
src/allmydata/test/bench_dirnode.py
src/allmydata/test/common.py
src/allmydata/test/no_network.py
src/allmydata/test/test_deepcheck.py
src/allmydata/test/test_dirnode.py
src/allmydata/test/test_filenode.py
src/allmydata/test/test_helper.py
src/allmydata/test/test_mutable.py
src/allmydata/test/test_system.py
src/allmydata/test/test_upload.py
src/allmydata/test/test_web.py
src/allmydata/uri.py
src/allmydata/web/directory.py
src/allmydata/web/root.py
src/allmydata/web/status.py