write None if we cannot find the json

This commit is contained in:
Jimmy Zelinskie 2015-10-02 11:59:23 -04:00
parent 627ad25c9c
commit 67497bb99c

View file

@ -51,7 +51,11 @@ def backfill_v1_metadata():
json_path = storage.image_json_path(uuid)
logger.debug('Updating image: %s from: %s', repo_image.id, json_path)
data = storage.get_content(repo_image.storage.locations, json_path)
try:
data = storage.get_content(repo_image.storage.locations, json_path)
except IOError:
data = None
logger.exception('failed to find v1 metadata, defaulting to None')
repo_image.v1_json_metadata = data
repo_image.save()
except ImageStoragePlacement.DoesNotExist: