mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-09 20:01:23 +00:00
dirnode.set_children: change return value: fire with self instead of None
This commit is contained in:
parent
f871c3bb3d
commit
d079eb45f6
@ -415,7 +415,9 @@ class DirectoryNode:
|
||||
msg = "cannot pack unknown node as child %s" % str(name)
|
||||
raise CannotPackUnknownNodeError(msg)
|
||||
a.set_node(name, child_node, metadata)
|
||||
return self._node.modify(a.modify)
|
||||
d = self._node.modify(a.modify)
|
||||
d.addCallback(lambda ign: self)
|
||||
return d
|
||||
|
||||
def set_node(self, name, child, metadata=None, overwrite=True):
|
||||
"""I add a child at the specific name. I return a Deferred that fires
|
||||
|
@ -901,9 +901,9 @@ class IDirectoryNode(IMutableFilesystemNode):
|
||||
"""Add multiple children (by writecap+readcap) to a directory node.
|
||||
Takes a dictionary, with childname as keys and (writecap, readcap)
|
||||
tuples (or (writecap, readcap, metadata) triples) as values. Returns
|
||||
a Deferred that fires (with None) when the operation finishes. This
|
||||
is equivalent to calling set_uri() multiple times, but is much more
|
||||
efficient. All child names must be unicode strings.
|
||||
a Deferred that fires (with this dirnode) when the operation
|
||||
finishes. This is equivalent to calling set_uri() multiple times, but
|
||||
is much more efficient. All child names must be unicode strings.
|
||||
"""
|
||||
|
||||
def set_node(name, child, metadata=None, overwrite=True):
|
||||
|
@ -455,6 +455,7 @@ class Dirnode(GridTestMixin, unittest.TestCase,
|
||||
u"e3": (fake_file_uri, fake_file_uri,
|
||||
{"key": "value"}),
|
||||
}))
|
||||
d.addCallback(lambda n2: self.failUnlessIdentical(n2, n))
|
||||
d.addCallback(lambda res:
|
||||
self.shouldFail(ExistingChildError, "set_children-no",
|
||||
"child 'e1' already exists",
|
||||
|
Loading…
x
Reference in New Issue
Block a user