Catch TypeError when new_size is None on extend

The volume_actions extend method does not catch/handle TypeError
exceptions.  The tempest volume_actions test includes a negative
test that doesn't pass in a new-size so the result is we get an
unhandled exception/trace in the log files for these runs.

Change-Id: I8b699a28e06e62126da02c3318d3129412dffa6b
Closes-Bug: #1259336
This commit is contained in:
john-griffith 2013-12-09 16:00:20 -07:00
parent 7689ff9a01
commit bc16517ac7
1 changed files with 1 additions and 1 deletions

View File

@ -257,7 +257,7 @@ class VolumeActionsController(wsgi.Controller):
try:
_val = int(body['os-extend']['new_size'])
except (KeyError, ValueError):
except (KeyError, ValueError, TypeError):
msg = _("New volume size must be specified as an integer.")
raise webob.exc.HTTPBadRequest(explanation=msg)