This commit is contained in:
Joseph Schorr 2014-09-26 12:22:30 -04:00
commit 76508218f4
21 changed files with 393 additions and 328 deletions

View file

@ -36,9 +36,13 @@ def backfill_sizes_from_json():
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