Correct the rest of the reraising of exception

When an exception was caught and rethrown, it should call 'raise'
without any arguments because it shows the place where an exception
occured initially instead of place where the exception re-raised.

Change-Id: I696054fc273edb62e87e5d567da6b99cdf5ec358
This commit is contained in:
qinchunhua 2016-07-11 02:30:10 -04:00
parent dcaa3af04e
commit 894f03b9f0
2 changed files with 5 additions and 4 deletions

6
magnum/common/exception.py Normal file → Executable file
View File

@ -89,18 +89,18 @@ class MagnumException(Exception):
try:
self.message = self.message % kwargs
except Exception as e:
except Exception:
# kwargs doesn't match a variable in the message
# log the issue and the kwargs
LOG.exception(_LE('Exception in string format operation, '
'kwargs: %s') % kwargs)
try:
if CONF.fatal_exception_format_errors:
raise e
raise
except cfg.NoSuchOptError:
# Note: work around for Bug: #1447873
if CONF.oslo_versionedobjects.fatal_exception_format_errors:
raise e
raise
super(MagnumException, self).__init__(self.message)

3
magnum/conductor/handlers/bay_conductor.py Normal file → Executable file
View File

@ -164,7 +164,8 @@ class Handler(object):
if isinstance(e, exc.HTTPBadRequest):
e = exception.InvalidParameterValue(message=six.text_type(e))
raise e
raise e
raise
bay.stack_id = created_stack['stack']['id']
bay.status = bay_status.CREATE_IN_PROGRESS