From 425b9049ead0fe28a63292d6695cee4da864d530 Mon Sep 17 00:00:00 2001 From: zancas Date: Thu, 9 Oct 2014 20:37:32 -0600 Subject: [PATCH] Do not report 'size' metadata if get_size returns None --- src/allmydata/web/common.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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): -- 2.45.2