summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2012-12-18 10:00:30 -0500
committerDan Prince <dprince@redhat.com>2012-12-18 14:27:19 -0500
commitf8d2f8689a31a7e81cdf06a4df45408a1a056595 (patch)
tree96e5a9c52575da550af43d8887a5e154301d7bf1
parent65d9f80b5bfe9e94323f31f2d109670798774466 (diff)
downloadnova-f8d2f8689a31a7e81cdf06a4df45408a1a056595.tar.gz
nova-f8d2f8689a31a7e81cdf06a4df45408a1a056595.tar.xz
nova-f8d2f8689a31a7e81cdf06a4df45408a1a056595.zip
Raise old exception instance instead of new one.
Updates the Nova conductor API's ExceptionHelper class so that it raises the previous exception instance instead of constructing a new exception class based on the old one's message. The motivation for this change is to enable testing of NovaException message formatting. Previously this function would always construct a new NovaException which had the incorrect (none) kwargs specified to properly format the message. The exception would get thrown... but it would cause extra LOG.error messages to appear in the log file due to the formatting errors. This commit works around the issue by raising the previous Exception directly. From 'pydoc raise': If the first object is an instance, the type of the exception is the class of the instance, the instance itself is the value, and the second object must be ``None``. Change-Id: I1dddc9e1e7e3d5f970baa9a34b709c943820295e
-rw-r--r--nova/conductor/api.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/nova/conductor/api.py b/nova/conductor/api.py
index 4c2f031e6..b0ac45935 100644
--- a/nova/conductor/api.py
+++ b/nova/conductor/api.py
@@ -55,7 +55,7 @@ class ExceptionHelper(object):
try:
return func(*args, **kwargs)
except rpc_common.ClientException, e:
- raise e._exc_info
+ raise (e._exc_info[1], None, e._exc_info[2])
return wrapper