diff options
| author | Alex Meade <alex.meade@rackspace.com> | 2011-08-10 21:27:40 -0400 |
|---|---|---|
| committer | Alex Meade <alex.meade@rackspace.com> | 2011-08-10 21:27:40 -0400 |
| commit | 0a543d4f8ff31733c32cbd9063e461ca41a0b076 (patch) | |
| tree | a2a098f9e1daab5ddf1262583dfc0aa2a0e76092 /nova/api | |
| parent | e78499c51b1cec93c0bdaadbcb78e71bf66d473d (diff) | |
Changed bad server actions requests to raise an HTTP 400
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/servers.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index 736fdf6ce..c7d17a5bc 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -210,11 +210,15 @@ class Controller(object): } self.actions.update(admin_actions) - for key in self.actions.keys(): - if key in body: + for key in body.keys(): + if key in self.actions: return self.actions[key](body, req, id) + else: + msg = _('There is no such server action: %s' % key) + raise exc.HTTPBadRequest(explanation=msg) - raise exc.HTTPNotImplemented() + msg = _('Invalid request body') + raise exc.HTTPBadRequest(explanation=msg) def _action_create_backup(self, input_dict, req, instance_id): """Backup a server instance. |
