diff --git a/endpoints/registry.py b/endpoints/registry.py index fc1575c1c..27c98d44e 100644 --- a/endpoints/registry.py +++ b/endpoints/registry.py @@ -128,7 +128,7 @@ def put_image_layer(namespace, repository, image_id): mark_path = store.image_mark_path(namespace, repository, image_id) if store.exists(layer_path) and not store.exists(mark_path): - abort(409, 'Image %(image_id)s already exists', issue='image-exists', image_id=image_id) + abort(409, 'Image already exists', issue='image-exists', image_id=image_id) input_stream = request.stream if request.headers.get('transfer-encoding') == 'chunked': @@ -364,7 +364,7 @@ def put_image_json(namespace, repository, image_id): json_path = store.image_json_path(namespace, repository, image_id) mark_path = store.image_mark_path(namespace, repository, image_id) if store.exists(json_path) and not store.exists(mark_path): - abort(409, 'Image %(image_id)s already exists', issue='image-exists', image_id=image_id) + abort(409, 'Image already exists', issue='image-exists', image_id=image_id) # If we reach that point, it means that this is a new image or a retry # on a failed push diff --git a/util/http.py b/util/http.py index 123029960..02b07c410 100644 --- a/util/http.py +++ b/util/http.py @@ -47,11 +47,10 @@ def abort(status_code, message=None, issue=None, **kwargs): # Create the final response data and message. data = {} + data['error'] = message + if issue_url: data['info_url'] = issue_url - message = message + '. For more information: ' + issue_url - - data['error'] = message resp = jsonify(data) resp.status_code = status_code