Bug 1027316
Summary: | openstack-glance: api v2 allow to add the same location twice | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat OpenStack | Reporter: | Yogev Rabl <yrabl> | ||||
Component: | openstack-glance | Assignee: | Flavio Percoco <fpercoco> | ||||
Status: | CLOSED ERRATA | QA Contact: | Tzach Shefi <tshefi> | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 4.0 | CC: | adahms, eglynn, fpercoco, nlevinki, yeylon | ||||
Target Milestone: | rc | ||||||
Target Release: | 5.0 (RHEL 7) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | openstack-glance-2014.1-2.el7ost | Doc Type: | Bug Fix | ||||
Doc Text: |
This update enhances the logic used to register multiple locations for the same image in Glance, preventing users from registering the same location more than once for a given image.
|
Story Points: | --- | ||||
Clone Of: | Environment: | ||||||
Last Closed: | 2014-07-08 15:31:38 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Yogev Rabl
2013-11-06 14:31:59 UTC
It is necessary to verify that location+metadata does not exist in the locations list. 1 URI with different metadata is considered a different location. Verified on: RHEL7 openstack-glance-2014.1-2.el7ost.noarch Uploaded an image (/var/lib/glance/images/63aa.. Using curl added a second location to that image # curl -i -X PATCH -H 'Content-Type: application/openstack-images-v2.1-json-patch' -H "X-Auth-Token: $AUTH" http://10.35.160.71:9292/v2/images/63aab139-519f-4161-8dc8-5474f05ac05e -d '[{"op": "add", "path": "/locations/1", "value": {"url": "http://mirrors.usc.edu/pub/linux/distributions/fedora/linux/releases/19/Live/x86_64/Fedora-Live-Desktop-x86_64-19-1.iso", "metadata": {}}}]' # glance --os-image-api-version 2 image-show 63aab139-519f-4161-8dc8-5474f05ac05e .... | | locations | [{u'url': u'file:///var/lib/glance/images/63aab139-519f-4161-8dc8-5474f05ac05e', u'metadata': {}}, {u'url': u'http://mirrors.usc.edu/pub/linux/distributions/fedora/linux/releases/19/Live/x86_64/Fedora-Live-Desktop-x86_64-19-1.iso', u'metadata': {}}] | | min_disk | 0 Running same curl command again (same location twice) got expected error: HTTP/1.1 400 Bad Request Content-Length: 273 Content-Type: text/html; charset=UTF-8 X-Openstack-Request-Id: req-b2c2872b-1570-4512-9b03-cfba9128efb1 Date: Tue, 10 Jun 2014 08:42:18 GMT <html> <head> <title>400 Bad Request</title> </head> <body> <h1>400 Bad Request</h1> The location http://mirrors.usc.edu/pub/linux/distributions/fedora/linux/releases/19/Live/x86_64/Fedora-Live-Desktop-x86_64-19-1.iso already exists<br /><br /> </body> </html>[root@puma31 ~(keystone_admin)]# Additional testing used curl to add another location (new unique URL), a third image location was added successfully. | locations | [{u'url': u'file:///var/lib/glance/images/63aab139-519f-4161-8dc8-5474f05ac05e', u'metadata': {}}, {u'url': u'http://mirrors.usc.edu/pub/linux/distributions/fedora/linux/releases/19/Live/x86_64/Fedora-Live-KDE-x86_64-19-1.iso', u'metadata': {}}, {u'url': u'http://mirrors.usc.edu/pub/linux/distributions/fedora/linux/releases/19/Live/x86_64/Fedora-Live-Desktop-x86_64-19-1.iso', u'metadata': {}}] | Attaching glance api.log Created attachment 907095 [details]
Glance API.log
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHEA-2014-0851.html Cancelling old needinfo request. |