summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Pepple <ken.pepple@gmail.com>2011-03-17 11:34:14 -0700
committerKen Pepple <ken.pepple@gmail.com>2011-03-17 11:34:14 -0700
commit6d6d0f686a7f8d47263b7ed725bdae0f322b2a4e (patch)
tree8617c6542b6e71efc6d6dcbc09b363bac0d8e106
parent4ca99e0cbbf328c6af76fd73ac5c72644422dc57 (diff)
downloadnova-6d6d0f686a7f8d47263b7ed725bdae0f322b2a4e.tar.gz
nova-6d6d0f686a7f8d47263b7ed725bdae0f322b2a4e.tar.xz
nova-6d6d0f686a7f8d47263b7ed725bdae0f322b2a4e.zip
better implementation of try..except..else
-rw-r--r--nova/image/local.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/nova/image/local.py b/nova/image/local.py
index c304a2212..609d6c42a 100644
--- a/nova/image/local.py
+++ b/nova/image/local.py
@@ -53,13 +53,13 @@ class LocalImageService(service.BaseImageService):
images = []
for image_dir in os.listdir(self._path):
try:
- images.append(int(image_dir, 16))
+ unhexed_image_id = int(image_dir, 16)
except ValueError:
LOG.error(
_("%s is not in correct directory naming format"\
% image_dir))
- except:
- raise
+ else:
+ images.append(unhexed_image_id)
return images
def index(self, context):