Correct 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: I57a1cb70ee7b7d839ccb86ae025b5161bd93a014
This commit is contained in:
wengjiangang 2016-07-11 03:08:30 -04:00 committed by qinchunhua
parent ac6e95b6ae
commit 77613948fd
4 changed files with 4 additions and 4 deletions

4
designate/backend/agent_backend/impl_djbdns.py Normal file → Executable file
View File

@ -79,8 +79,8 @@ def filter_exceptions(fn):
def wrapper(*a, **kw):
try:
return fn(*a, **kw)
except exceptions.Backend as e:
raise e
except exceptions.Backend:
raise
except Exception as e:
LOG.error(_LE("Unhandled exception %s"), str(e), exc_info=True)
raise exceptions.Backend(str(e))

2
designate/backend/agent_backend/impl_knot2.py Normal file → Executable file
View File

@ -141,7 +141,7 @@ class Knot2Backend(base.AgentBackend):
except Exception as e:
self._execute_knotc('conf-abort')
LOG.info(_LI("Zone change aborted: %r"), e)
raise e
raise
else:
self._execute_knotc('conf-commit')

2
designate/backend/impl_dynect.py Normal file → Executable file
View File

@ -372,7 +372,7 @@ class DynECTBackend(base.Backend):
client.put(url, data=data)
break
else:
raise e
raise
client.put(url, data={'activate': True})
client.logout()

0
designate/objects/recordset.py Normal file → Executable file
View File