[tahoe-lafs-trac-stream] [Tahoe-LAFS] #1634: TypeError due to "size" being None in pyfilesystem+dokan
Tahoe-LAFS
trac at tahoe-lafs.org
Thu Oct 2 21:10:38 UTC 2014
#1634: TypeError due to "size" being None in pyfilesystem+dokan
-------------------------+-------------------------------------------------
Reporter: zooko | Owner: Zancas
Type: defect | Status: new
Priority: major | Milestone: 1.11.0
Component: code- | Version: 1.9.0
frontend-web | Keywords: pyfilesystem dokan error webapi
Resolution: | docs mutable test-needed
Launchpad Bug: |
-------------------------+-------------------------------------------------
Comment (by Zancas):
If I Understand Correctly (IIUC), Warner and I agree that the following
steps would constitute a reasonable approach to this issue:
1. refactor synchronous node metadata acquisition as exemplified by
[[https://github.com/tahoe-lafs/tahoe-
lafs/blob/master/src/allmydata/interfaces.py#L886|get_size]] into a
discrete function (which lives in web/common.py?):
get_childnode_metadata(childnode) --> {metadata1:value,
metadata2:value, etc...}
[1a. If it increases DRYness also refactor JSON dumping into discrete
function]
2. use the new function[s] when the webserver handles requests against
the backend asking for
that metadata, see below "grep" results:
{{{
$ grep -n -r -e"node\.get_size" src/allmydata/web
src/allmydata/web/filenode.py:361: filesize =
self.filenode.get_size()
src/allmydata/web/filenode.py:422: filesize =
self.filenode.get_size()
src/allmydata/web/filenode.py:502: data[1]['size'] =
filenode.get_size()
src/allmydata/web/directory.py:882: kiddata = ("filenode",
{'size': childnode.get_size(),
}}}
CAVEAT EMPTOR:
"get_current_size" type requests which return a deferred (e.g. ~
web/info.py line 63) are not affected by this refactor
... ehhh still working on this ticket, but I'm switching to my laptop,
so look forward to the next comment.
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1634#comment:22>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list