summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/volume/volumes.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/nova/api/openstack/volume/volumes.py b/nova/api/openstack/volume/volumes.py
index 4c12638b4..ec9a47a74 100644
--- a/nova/api/openstack/volume/volumes.py
+++ b/nova/api/openstack/volume/volumes.py
@@ -218,7 +218,17 @@ class VolumeController(object):
raise exc.HTTPUnprocessableEntity()
volume = body['volume']
- size = volume['size']
+
+ def as_int(s):
+ try:
+ return int(s)
+ except ValueError:
+ return s
+
+ # NOTE(eglynn): we're tolerant of non-int sizes here, as type
+ # integrity is enforced later in the creation codepath
+ size = as_int(volume['size'])
+
LOG.audit(_("Create volume of %s GB"), size, context=context)
kwargs = {}