Fix a bug in the concurrent push code which prevented failed pushes from being resumed.

This commit is contained in:
Jake Moshenko 2015-02-19 16:46:01 -05:00
parent f650479266
commit 4e5d671349

View file

@ -455,14 +455,15 @@ def put_image_json(namespace, repository, image_id):
issue='invalid-request', image_id=image_id)
logger.debug('Looking up repo image')
repo = model.get_repository(namespace, repository)
if repo is None:
abort(404, 'Repository does not exist: %(namespace)s/%(repository)s', issue='no-repo',
namespace=namespace, repository=repository)
repo_image = model.get_repo_image_extended(namespace, repository, image_id)
if not repo_image:
logger.debug('Image not found, creating image')
repo = model.get_repository(namespace, repository)
if repo is None:
abort(404, 'Repository does not exist: %(namespace)s/%(repository)s', issue='no-repo',
namespace=namespace, repository=repository)
username = get_authenticated_user() and get_authenticated_user().username
repo_image = model.find_create_or_link_image(image_id, repo, username, {},
store.preferred_locations[0])