Move size and checksum updates into the metadata call

This commit is contained in:
Joseph Schorr 2014-09-23 15:49:28 -04:00
parent 74e35f917e
commit ec484e3efc
3 changed files with 8 additions and 11 deletions

View file

@ -451,12 +451,6 @@ def put_image_json(namespace, repository, image_id):
set_uploading_flag(repo_image, True)
# We cleanup any old checksum in case it's a retry after a fail
profile.debug('Cleanup old checksum and save size')
repo_image.storage.uncompressed_size = data.get('Size')
repo_image.storage.checksum = None
repo_image.storage.save()
# If we reach that point, it means that this is a new image or a retry
# on a failed push
# save the metadata
@ -466,7 +460,7 @@ def put_image_json(namespace, repository, image_id):
profile.debug('Setting image metadata')
model.set_image_metadata(image_id, namespace, repository,
data.get('created'), data.get('comment'), command,
parent_image)
data.get('Size'), parent_image)
profile.debug('Putting json path')
store.put_content(repo_image.storage.locations, json_path, request.data)