summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorAnthony Young <sleepsonthefloor@gmail.com>2011-08-19 14:16:57 -0700
committerAnthony Young <sleepsonthefloor@gmail.com>2011-08-19 14:16:57 -0700
commit9b65cdf0b2d5cc7ed7adcaca0dde4d6e2a10bf95 (patch)
treef903fa0575c382a1106d45b44b32bdbb677938ac /nova/api
parentce4ac4be2b813a8f025a9f2891fbc1ed4101c496 (diff)
downloadnova-9b65cdf0b2d5cc7ed7adcaca0dde4d6e2a10bf95.tar.gz
nova-9b65cdf0b2d5cc7ed7adcaca0dde4d6e2a10bf95.tar.xz
nova-9b65cdf0b2d5cc7ed7adcaca0dde4d6e2a10bf95.zip
better handle malformed input, and add associated tests
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/contrib/floating_ips.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/nova/api/openstack/contrib/floating_ips.py b/nova/api/openstack/contrib/floating_ips.py
index 0f27f2f27..40086f778 100644
--- a/nova/api/openstack/contrib/floating_ips.py
+++ b/nova/api/openstack/contrib/floating_ips.py
@@ -131,6 +131,9 @@ class Floating_ips(extensions.ExtensionDescriptor):
try:
address = input_dict['addFloatingIp']['address']
+ except TypeError:
+ msg = _("Missing parameter dict")
+ raise webob.exc.HTTPBadRequest(explanation=msg)
except KeyError:
msg = _("Address not specified")
raise webob.exc.HTTPBadRequest(explanation=msg)
@@ -145,6 +148,9 @@ class Floating_ips(extensions.ExtensionDescriptor):
try:
address = input_dict['removeFloatingIp']['address']
+ except TypeError:
+ msg = _("Missing parameter dict")
+ raise webob.exc.HTTPBadRequest(explanation=msg)
except KeyError:
msg = _("Address not specified")
raise webob.exc.HTTPBadRequest(explanation=msg)