diff --git a/tools/uncompressedsize.py b/tools/uncompressedsize.py index 32ba0957c..4ed9a772a 100644 --- a/tools/uncompressedsize.py +++ b/tools/uncompressedsize.py @@ -34,9 +34,13 @@ def backfill_sizes(): uuid = image_storage.uuid with_locations = model.get_storage_by_uuid(uuid) - json_string = store.get_content(with_locations.locations, store.image_json_path(uuid)) - json_data = json.loads(json_string) - size = json_data.get('Size', json_data.get('size', -1)) + try: + json_string = store.get_content(with_locations.locations, store.image_json_path(uuid)) + json_data = json.loads(json_string) + size = json_data.get('Size', json_data.get('size', -1)) + except IOError: + logger.debug('Image storage with no json %s', uuid) + size = -1 if size == -1: missing += 1