diff options
author | Ken Pepple <ken.pepple@gmail.com> | 2011-03-17 11:34:14 -0700 |
---|---|---|
committer | Ken Pepple <ken.pepple@gmail.com> | 2011-03-17 11:34:14 -0700 |
commit | 6d6d0f686a7f8d47263b7ed725bdae0f322b2a4e (patch) | |
tree | 8617c6542b6e71efc6d6dcbc09b363bac0d8e106 | |
parent | 4ca99e0cbbf328c6af76fd73ac5c72644422dc57 (diff) | |
download | nova-6d6d0f686a7f8d47263b7ed725bdae0f322b2a4e.tar.gz nova-6d6d0f686a7f8d47263b7ed725bdae0f322b2a4e.tar.xz nova-6d6d0f686a7f8d47263b7ed725bdae0f322b2a4e.zip |
better implementation of try..except..else
-rw-r--r-- | nova/image/local.py | 6 |
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): |