Prevent mutable objects from being retrieved from an immutable directory, and associated forward-compatibility improvements.

This commit is contained in:
david-sarah
2010-01-26 22:44:30 -08:00
parent 3880486f91
commit 6057bc02cc
27 changed files with 1672 additions and 509 deletions

View File

@ -471,13 +471,16 @@ class Client(node.Node, pollmixin.PollMixin):
# dirnodes. The first takes a URI and produces a filenode or (new-style)
# dirnode. The other three create brand-new filenodes/dirnodes.
def create_node_from_uri(self, writecap, readcap=None):
# this returns synchronously.
return self.nodemaker.create_from_cap(writecap, readcap)
def create_node_from_uri(self, write_uri, read_uri=None, deep_immutable=False, name="<unknown name>"):
# This returns synchronously.
# Note that it does *not* validate the write_uri and read_uri; instead we
# may get an opaque node if there were any problems.
return self.nodemaker.create_from_cap(write_uri, read_uri, deep_immutable=deep_immutable, name=name)
def create_dirnode(self, initial_children={}):
d = self.nodemaker.create_new_mutable_directory(initial_children)
return d
def create_immutable_dirnode(self, children, convergence=None):
return self.nodemaker.create_immutable_directory(children, convergence)