Merge pull request #685 from coreos-inc/fixmigration
write None if we cannot find the json
This commit is contained in:
commit
dd93710c49
1 changed files with 5 additions and 1 deletions
|
@ -51,7 +51,11 @@ def backfill_v1_metadata():
|
||||||
json_path = storage.image_json_path(uuid)
|
json_path = storage.image_json_path(uuid)
|
||||||
|
|
||||||
logger.debug('Updating image: %s from: %s', repo_image.id, json_path)
|
logger.debug('Updating image: %s from: %s', repo_image.id, json_path)
|
||||||
|
try:
|
||||||
data = storage.get_content(repo_image.storage.locations, json_path)
|
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.v1_json_metadata = data
|
||||||
repo_image.save()
|
repo_image.save()
|
||||||
except ImageStoragePlacement.DoesNotExist:
|
except ImageStoragePlacement.DoesNotExist:
|
||||||
|
|
Reference in a new issue