From: Glenn M. Gobeli Date: Tue, 11 Feb 2014 18:03:13 +0000 (-0500) Subject: Changes to cast variable as integer as XML API fails. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=26f9b33085b20a3967299a4d3b2ec871bd6a40d0;p=openstack-build%2Fcinder-build.git Changes to cast variable as integer as XML API fails. Code change to ensure that the type of the size variable is correct when cinder is invoked through XML API. The extend volume code path differs from volume create where the flow portion verifies that the size variable is an integer; for extend the earliest place to cast the size variable is in volume_actions.py. Change-Id: Iaaed463f988769b8093604cd3b677b270dd2c5cd Closes-bug: 1277233 --- diff --git a/cinder/api/contrib/volume_actions.py b/cinder/api/contrib/volume_actions.py index 2e87b4e0f..ebe24485d 100644 --- a/cinder/api/contrib/volume_actions.py +++ b/cinder/api/contrib/volume_actions.py @@ -280,7 +280,7 @@ class VolumeActionsController(wsgi.Controller): msg = _("New volume size must be specified as an integer.") raise webob.exc.HTTPBadRequest(explanation=msg) - size = body['os-extend']['new_size'] + size = int(body['os-extend']['new_size']) self.volume_api.extend(context, volume, size) return webob.Response(status_int=202)