Fixed an error when caching multiple images in aggregate
Because in the process of judging whether the image id is Duplicate,there is only deduplication without sorting, so no duplicate image error is judged as duplicate and an error "Duplicate images in request" is reported. Now it is changed to sort after deduplication and then compare. Two unit test cases were added to verify the fix Related-Bug: #2034702 Change-Id: I300a3e29ba56584f4c99d534a6cf8ee7dc0ed4b7
This commit is contained in:
@@ -289,7 +289,7 @@ class AggregateController(wsgi.Controller):
|
||||
for image_req in body.get('cache'):
|
||||
image_ids.append(image_req['id'])
|
||||
|
||||
if image_ids != list(set(image_ids)):
|
||||
if sorted(image_ids) != sorted(list(set(image_ids))):
|
||||
raise exc.HTTPBadRequest(
|
||||
explanation=_('Duplicate images in request'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user