From: Brian Warner Date: Tue, 13 Oct 2009 01:45:46 +0000 (-0700) Subject: dirnode.set_nodes: change return value: fire with self instead of None X-Git-Tag: trac-4100~21 X-Git-Url: https://git.rkrishnan.org/?a=commitdiff_plain;h=f871c3bb3ddc3b42c2851bb448d6c62a2ef6fac4;p=tahoe-lafs%2Ftahoe-lafs.git dirnode.set_nodes: change return value: fire with self instead of None --- diff --git a/src/allmydata/dirnode.py b/src/allmydata/dirnode.py index 8dc9139c..4a2e751f 100644 --- a/src/allmydata/dirnode.py +++ b/src/allmydata/dirnode.py @@ -443,7 +443,7 @@ class DirectoryNode: return defer.fail(NotMutableError()) a = Adder(self, entries, overwrite=overwrite) d = self._node.modify(a.modify) - d.addCallback(lambda res: None) + d.addCallback(lambda res: self) return d diff --git a/src/allmydata/interfaces.py b/src/allmydata/interfaces.py index d2a93e3e..f07788f5 100644 --- a/src/allmydata/interfaces.py +++ b/src/allmydata/interfaces.py @@ -926,8 +926,8 @@ class IDirectoryNode(IMutableFilesystemNode): def set_nodes(entries, overwrite=True): """Add multiple (name, child_node) pairs (or (name, child_node, metadata) triples) to a directory node. Returns a Deferred that fires - (with None) when the operation finishes. This is equivalent to - calling set_node() multiple times, but is much more efficient. All + (with this dirnode) when the operation finishes. This is equivalent + to calling set_node() multiple times, but is much more efficient. All child names must be unicode strings.""" diff --git a/src/allmydata/test/test_dirnode.py b/src/allmydata/test/test_dirnode.py index b4c2f760..c6841170 100644 --- a/src/allmydata/test/test_dirnode.py +++ b/src/allmydata/test/test_dirnode.py @@ -490,6 +490,7 @@ class Dirnode(GridTestMixin, unittest.TestCase, (u"f3", n, {"key": "value"}), ])) + d.addCallback(lambda n2: self.failUnlessIdentical(n2, n)) d.addCallback(lambda res: self.shouldFail(ExistingChildError, "set_nodes-no", "child 'f1' already exists",