]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix exception when size is None.
authorMatthew Treinish <treinish@linux.vnet.ibm.com>
Thu, 29 Nov 2012 22:48:03 +0000 (17:48 -0500)
committerMatthew Treinish <treinish@linux.vnet.ibm.com>
Fri, 30 Nov 2012 18:39:02 +0000 (13:39 -0500)
If an incoming create request has a size of None raise
an exception.

Fixes: bug 1084711
Change-Id: I5ad377073cc6853b502889ad9292b5758522ca88

cinder/volume/api.py

index 3b53a6dcc75927c194eb68f6ef611733ab5471d6..36b6ea5bc2265ae7b5460ff7e39c1421d23978b8 100644 (file)
@@ -103,7 +103,7 @@ class API(base.Base):
         def as_int(s):
             try:
                 return int(s)
-            except ValueError, TypeError:
+            except (ValueError, TypeError):
                 return s
 
         # tolerate size as stringified int