From 3fe5bd6a7112315a978be38a9e51a1787b300af3 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 27 Nov 2012 10:41:25 -0500 Subject: [PATCH] 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 --- cinder/volume/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.45.2