Filtering flavors by an invalid minRam returns all flavors

Bug #992662 reported by Daryl Walleck
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Alex Meade

Bug Description

If I pass a non-integer value as a param for the minRam or minDisk filters, all flavors are returned instead of none, which would be expected since the filter found no matches.

Daryls-MacBook-Pro:zodiac dwalleck$ curl -ik -H "X-Auth-Token: 9486cec5-a29e-4811-821e-92148d2c0a68" https:\/\/127.0.0.1\/v2\/5820784/flavors?minRam=dhdhd
HTTP/1.1 200 OK
Date: Tue, 01 May 2012 15:16:54 GMT
Content-Length: 2011
Content-Type: application/json
X-Compute-Request-Id: req-dc0904ac-91fa-4a8c-9c47-71f9f8cb2682
Server: Jetty(8.0.y.z-SNAPSHOT)

{"flavors": [{"id": "1", "links": [{"href": "https://127.0.0.1/v2/5820784/flavors/1", "rel": "self"}, {"href": "https://127.0.0.1/5820784/flavors/1", "rel": "bookmark"}], "name": "256MB instance"}, {"id": "2", "links": [{"href": "https://127.0.0.1/v2/5820784/flavors/2", "rel": "self"}, {"href": "https://127.0.0.1/5820784/flavors/2", "rel": "bookmark"}], "name": "512MB instance"}, {"id": "3", "links": [{"href": "https://127.0.0.1/v2/5820784/flavors/3", "rel": "self"}, {"href": "https://127.0.0.1/5820784/flavors/3", "rel": "bookmark"}], "name": "1GB instance"}, {"id": "4", "links": [{"href": "https://127.0.0.1/v2/5820784/flavors/4", "rel": "self"}, {"href": "https://127.0.0.1/5820784/flavors/4", "rel": "bookmark"}], "name": "2GB instance"}, {"id": "5", "links": [{"href": "https://127.0.0.1/v2/5820784/flavors/5", "rel": "self"}, {"href": "https://127.0.0.1/5820784/flavors/5", "rel": "bookmark"}], "name": "4GB instance"}, {"id": "6", "links": [{"href": "https://127.0.0.1/v2/5820784/flavors/6", "rel": "self"}, {"href": "https://127.0.0.1/5820784/flavors/6", "rel": "bookmark"}], "name": "8GB instance"}, {"id": "7", "links": [{"href": "https://127.0.0.1/v2/5820784/flavors/7", "rel": "self"}, {"href": "https://127.0.0.1/5820784/flavors/7", "rel": "bookmark"}], "name": "15GB instance"}, {"id": "8", "links": [{"href": "https://127.0.0.1/v2/5820784/flavors/8", "rel": "self"}, {"href": "https://127.0.0.1/5820784/flavors/8", "rel": "bookmark"}], "name": "30GB instance"}]}

Revision history for this message
Brian Waldon (bcwaldon) wrote :

I would actually expect a 400 to be returned, as we can't reasonably fulfill the request for minRam>True or minRam<'a'.

Changed in nova:
status: New → Triaged
milestone: none → folsom-1
Revision history for this message
Daryl Walleck (dwalleck) wrote :

That's a fair response as well. All results is just a bit peculiar, so anything more sensible is fine by me.

Alex Meade (alex-meade)
Changed in nova:
status: Triaged → In Progress
assignee: nobody → Alex Meade (alex-meade)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/6971

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/6971
Committed: http://github.com/openstack/nova/commit/b25752b2e742e4bcf872c0dfb9ca59f3e5d51ae9
Submitter: Jenkins
Branch: master

commit b25752b2e742e4bcf872c0dfb9ca59f3e5d51ae9
Author: Alex Meade <email address hidden>
Date: Tue May 1 13:08:10 2012 -0400

    Return a BadRequest on bad flavors param values.

    This changes the api to return a 400 bad request when a minRam or minDisk param with a non-integer value is provided when listing flavors.

    Fixes bug 992662

    Change-Id: I78bd32d0cde842547cb96767e4eb41f546aedbdf

Changed in nova:
status: In Progress → Fix Committed
Devin Carlen (devcamcar)
Changed in nova:
importance: Undecided → Low
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-1 → 2012.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.