]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix None being passed into as_int().
authorMatthew Treinish <treinish@linux.vnet.ibm.com>
Tue, 27 Nov 2012 15:41:25 +0000 (10:41 -0500)
committerMatthew Treinish <treinish@linux.vnet.ibm.com>
Tue, 27 Nov 2012 15:58:00 +0000 (10:58 -0500)
Currently when a create is received and the size is of NoneType
a stack trace is dumped because of the TypeError. This will
correct it so the functionality won't change, but the TypeError
is will be caught now.

Change-Id: Ic83dd182e0083c887af8f6209a23af38bfff2be7

cinder/volume/api.py

index 18c341b775d6529b44eb8c67c2180c01cfd76495..7b1e819405718956227b17318a07a5624c091c2c 100644 (file)
@@ -102,7 +102,7 @@ class API(base.Base):
         def as_int(s):
             try:
                 return int(s)
-            except ValueError:
+            except ValueError, TypeError:
                 return s
 
         # tolerate size as stringified int