summaryrefslogtreecommitdiffstats
path: root/nova/image
diff options
context:
space:
mode:
authorMatthew Hooker <matt@cloudscaling.com>2011-08-03 19:17:08 -0400
committerMatthew Hooker <matt@cloudscaling.com>2011-08-03 19:17:08 -0400
commitf34a6fb9efd8d950555431f5e7268dbde8ae78c8 (patch)
tree3a644a8729b97e69e41c87cb4835bef85b4681a4 /nova/image
parente2770a4558c95aa4b6e276ebe18dc580a82e6d67 (diff)
Remove instances of the "diaper pattern"
Anywhere "except:" occurs, I tried to replace it with an explicit except on known error types. If none were known, Except was used. In the process I've been able to unearth a few evasive bugs and clean up some adjacent code.
Diffstat (limited to 'nova/image')
-rw-r--r--nova/image/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/image/__init__.py b/nova/image/__init__.py
index a27d649d4..5447c8a3a 100644
--- a/nova/image/__init__.py
+++ b/nova/image/__init__.py
@@ -35,6 +35,7 @@ def _parse_image_ref(image_href):
:param image_href: href of an image
:returns: a tuple of the form (image_id, host, port)
+ :raises ValueError
"""
o = urlparse(image_href)
@@ -72,7 +73,7 @@ def get_glance_client(image_href):
try:
(image_id, host, port) = _parse_image_ref(image_href)
- except:
+ except ValueError:
raise exception.InvalidImageRef(image_href=image_href)
glance_client = GlanceClient(host, port)
return (glance_client, image_id)