]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Catch TypeError when new_size is None on extend
authorjohn-griffith <john.griffith@solidfire.com>
Mon, 9 Dec 2013 23:00:20 +0000 (16:00 -0700)
committerjohn-griffith <john.griffith@solidfire.com>
Mon, 9 Dec 2013 23:00:20 +0000 (16:00 -0700)
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

cinder/api/contrib/volume_actions.py

index fbec56699529e33ae0cf24e34d2061b5c129939f..abea4d96faa4305cab7f549a251a029f95e8056c 100644 (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)