From bc16517ac7351b715d0202f7beb5a5e0d7ff8f97 Mon Sep 17 00:00:00 2001 From: john-griffith Date: Mon, 9 Dec 2013 16:00:20 -0700 Subject: [PATCH] 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 --- cinder/api/contrib/volume_actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cinder/api/contrib/volume_actions.py b/cinder/api/contrib/volume_actions.py index fbec56699..abea4d96f 100644 --- a/cinder/api/contrib/volume_actions.py +++ b/cinder/api/contrib/volume_actions.py @@ -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) -- 2.45.2