From: Matthew Treinish Date: Tue, 27 Nov 2012 15:41:25 +0000 (-0500) Subject: Fix None being passed into as_int(). X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=3fe5bd6a7112315a978be38a9e51a1787b300af3;p=openstack-build%2Fcinder-build.git Fix None being passed into as_int(). 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 --- diff --git a/cinder/volume/api.py b/cinder/volume/api.py index 18c341b77..7b1e81940 100644 --- a/cinder/volume/api.py +++ b/cinder/volume/api.py @@ -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