From: zancas Date: Fri, 10 Oct 2014 02:37:32 +0000 (-0600) Subject: Do not report 'size' metadata if get_size returns None X-Git-Tag: allmydata-tahoe-1.10.1a1~114^2 X-Git-Url: https://git.rkrishnan.org/specifications/%5B/%5D%20/uri/reliability?a=commitdiff_plain;h=425b9049ead0fe28a63292d6695cee4da864d530;p=tahoe-lafs%2Ftahoe-lafs.git Do not report 'size' metadata if get_size returns None --- diff --git a/src/allmydata/web/common.py b/src/allmydata/web/common.py index 2d15281c..2c873206 100644 --- a/src/allmydata/web/common.py +++ b/src/allmydata/web/common.py @@ -19,8 +19,7 @@ from allmydata.util.encodingutil import to_str, quote_output TIME_FORMAT = "%H:%M:%S %d-%b-%Y" def get_filenode_metadata(filenode): - metadata = {'size': filenode.get_size(), - 'mutable': filenode.is_mutable()} + metadata = {'mutable': filenode.is_mutable()} if metadata['mutable']: mutable_type = filenode.get_version() assert mutable_type in (SDMF_VERSION, MDMF_VERSION) @@ -31,6 +30,8 @@ def get_filenode_metadata(filenode): else: file_format = "CHK" metadata['format'] = file_format + if filenode.get_size() is not None: + metadata['size'] = filenode.get_size() return metadata class IOpHandleTable(Interface):