From: david-sarah Date: Tue, 8 Jun 2010 06:37:53 +0000 (-0700) Subject: SFTP: suppress NoSuchChildError if heisenfile attributes have been updated in setAttr... X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20//%22%22?a=commitdiff_plain;h=4b5927fdb868742563601ceb7c71831b1aae4ae4;p=tahoe-lafs%2Ftahoe-lafs.git SFTP: suppress NoSuchChildError if heisenfile attributes have been updated in setAttrs, in the case where the parent is available. --- diff --git a/src/allmydata/frontends/sftpd.py b/src/allmydata/frontends/sftpd.py index e09d845c..5d54962b 100644 --- a/src/allmydata/frontends/sftpd.py +++ b/src/allmydata/frontends/sftpd.py @@ -1162,6 +1162,7 @@ class SFTPUserHandler(ConchUser, PrefixingLogMixin): def _done(ign): self.log("done %r" % (request,), level=OPERATIONAL) + # TODO: this should not return True if only_if_at caused all files to be skipped. return len(files) > 0 d.addBoth(_done) return d @@ -1707,7 +1708,14 @@ class SFTPUserHandler(ConchUser, PrefixingLogMixin): desired_metadata = _attrs_to_metadata(attrs) if noisy: self.log("desired_metadata = %r" % (desired_metadata,), level=NOISY) - return parent_or_node.set_metadata_for(childname, desired_metadata) + d3 = parent_or_node.set_metadata_for(childname, desired_metadata) + def _nosuch(err): + if updated_heisenfiles: + err.trap(NoSuchChildError) + else: + return err + d3.addErrback(_nosuch) + return d3 d2.addCallback(_update) d2.addCallback(lambda ign: None) return d2