diff options
| author | Alex Meade <alex.meade@rackspace.com> | 2012-05-01 13:08:10 -0400 |
|---|---|---|
| committer | Alex Meade <alex.meade@rackspace.com> | 2012-05-01 13:12:13 -0400 |
| commit | b25752b2e742e4bcf872c0dfb9ca59f3e5d51ae9 (patch) | |
| tree | 670b93ccad88d30f051e3d5db35e166add3da3e1 /nova/api | |
| parent | e6b1370d823cdcdb5201152010f0bb27e424b2d3 (diff) | |
| download | nova-b25752b2e742e4bcf872c0dfb9ca59f3e5d51ae9.tar.gz nova-b25752b2e742e4bcf872c0dfb9ca59f3e5d51ae9.tar.xz nova-b25752b2e742e4bcf872c0dfb9ca59f3e5d51ae9.zip | |
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
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/flavors.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/nova/api/openstack/compute/flavors.py b/nova/api/openstack/compute/flavors.py index 8c159c586..6757d8b28 100644 --- a/nova/api/openstack/compute/flavors.py +++ b/nova/api/openstack/compute/flavors.py @@ -98,13 +98,15 @@ class Controller(wsgi.Controller): try: filters['min_memory_mb'] = int(req.params['minRam']) except ValueError: - pass # ignore bogus values per spec + msg = _('Invalid minRam filter [%s]') % req.params['minRam'] + raise webob.exc.HTTPBadRequest(explanation=msg) if 'minDisk' in req.params: try: filters['min_root_gb'] = int(req.params['minDisk']) except ValueError: - pass # ignore bogus values per spec + msg = _('Invalid minDisk filter [%s]') % req.params['minDisk'] + raise webob.exc.HTTPBadRequest(explanation=msg) flavors = instance_types.get_all_types(filters=filters) flavors_list = flavors.values() |
