From 8ee10c55b045ab6d85b41dddbbb95384d009fb9b Mon Sep 17 00:00:00 2001 From: jiataotj Date: Tue, 28 May 2013 18:20:15 +0800 Subject: Add invalid number checking in flavor creation api Flavor creation api doesn't check whether 'memory_mb' argument number is integer,add invalid number checking into the flavor creation function to remind the user to input right value Fixes bug #1171278 Change-Id: I8308f66c485d8c872864661148e9eac7b685e406 --- nova/api/openstack/compute/contrib/flavormanage.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'nova/api') diff --git a/nova/api/openstack/compute/contrib/flavormanage.py b/nova/api/openstack/compute/contrib/flavormanage.py index 43d5d2110..441858c25 100644 --- a/nova/api/openstack/compute/contrib/flavormanage.py +++ b/nova/api/openstack/compute/contrib/flavormanage.py @@ -76,6 +76,8 @@ class FlavorManageController(wsgi.Controller): except (exception.InstanceTypeExists, exception.InstanceTypeIdExists) as err: raise webob.exc.HTTPConflict(explanation=err.format_message()) + except exception.InvalidInput as exc: + raise webob.exc.HTTPBadRequest(explanation=exc.format_message()) return self._view_builder.show(req, flavor) -- cgit