Removing redundant validation for rebuild request.

Any method decorated with wsgi.action will need to have
the said key, in this case 'rebuild', before it
reaches the relevant code block. If not, a key
error is raised when the wsgi.action code kicks in. This
code is at openstack/wsgi.py in the  _process_stack
method and subsequently the self.get_method method.
A KeyError is raised and caught. Removing the redundant
check for rebuild api.

Change-Id: I4baf920c7e1b3d51a91323f12d0802cedec77fe2
This commit is contained in:
Claxton
2013-11-27 15:05:21 +05:30
parent 94db56755e
commit 28eedd2d55
2 changed files with 2 additions and 10 deletions

View File

@@ -1304,11 +1304,7 @@ class Controller(wsgi.Controller):
@wsgi.action('rebuild')
def _action_rebuild(self, req, id, body):
"""Rebuild an instance with the given attributes."""
try:
body = body['rebuild']
except (KeyError, TypeError):
msg = _('Invalid request body')
raise exc.HTTPBadRequest(explanation=msg)
body = body['rebuild']
try:
image_href = body["imageRef"]