Merge "Remove location check from V2 client"

This commit is contained in:
Jenkins
2016-01-15 05:27:20 +00:00
committed by Gerrit Code Review
2 changed files with 8 additions and 19 deletions
-6
View File
@@ -306,12 +306,6 @@ class Controller(object):
:param metadata: Metadata associated with the location.
:returns: The updated image
"""
image = self._get_image_with_locations_or_fail(image_id)
url_list = [l['url'] for l in image.locations]
if url in url_list:
err_str = 'A location entry at %s already exists' % url
raise exc.HTTPConflict(err_str)
add_patch = [{'op': 'add', 'path': '/locations/-',
'value': {'url': url, 'metadata': metadata}}]
self._send_image_update_request(image_id, add_patch)