From d6cc971de571078708c4e58938d2add850cf7b8f Mon Sep 17 00:00:00 2001 From: Tobias Henkel Date: Thu, 2 Aug 2018 08:42:24 +0200 Subject: [PATCH] Remove mimetype check when calculating size We currently try to skip size formatting for folders. However we compare with a bogix mimetype so the check is false in every case. Further folders typically have a size of 512 bytes or 4k. In both cases we don't really need to skip the size formatting so instead of fixing the check just skip it and do the size formatting unconditionally. Change-Id: I7ef021381bb56acf4b22551cc5d5613470fd6d08 --- roles/upload-logs-swift/library/zuul_swift_upload.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/roles/upload-logs-swift/library/zuul_swift_upload.py b/roles/upload-logs-swift/library/zuul_swift_upload.py index 00522e9b9..e2aa46c98 100755 --- a/roles/upload-logs-swift/library/zuul_swift_upload.py +++ b/roles/upload-logs-swift/library/zuul_swift_upload.py @@ -362,10 +362,7 @@ class Indexer(): filename) output += '%s' % time.asctime( file_details.last_modified) - if file_details.mimetype == 'folder': - size = str(file_details.size) - else: - size = sizeof_fmt(file_details.size, suffix='') + size = sizeof_fmt(file_details.size, suffix='') output += '%s' % size output += '\n'