From 6d6d0f686a7f8d47263b7ed725bdae0f322b2a4e Mon Sep 17 00:00:00 2001 From: Ken Pepple Date: Thu, 17 Mar 2011 11:34:14 -0700 Subject: better implementation of try..except..else --- nova/image/local.py | 6 +++--- 1 file 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): -- cgit