Keep Trace Back in Exception

While catching exception, we should use 'raise' directly if we parsing
same exception to upper level. In this way, we will not losing trace
back information.

Change-Id: I9cb208bb355082907b789dffa8de28dd33c9f01d
This commit is contained in:
ricolin 2016-05-31 00:28:52 +08:00
parent 5b2bcd8b2e
commit 74d3131415
6 changed files with 7 additions and 7 deletions

View File

@ -62,7 +62,7 @@ class BarbicanClientPlugin(client_plugin.ClientPlugin):
raise exception.EntityNotFound(
entity="Secret",
name=secret_ref)
raise ex
raise
def get_container_by_ref(self, container_ref):
try:
@ -73,7 +73,7 @@ class BarbicanClientPlugin(client_plugin.ClientPlugin):
raise exception.EntityNotFound(
entity="Container",
name=container_ref)
raise ex
raise
class SecretConstraint(constraints.BaseCustomConstraint):

View File

@ -59,7 +59,7 @@ class MistralClientPlugin(client_plugin.ClientPlugin):
raise exception.EntityNotFound(
entity="Workflow",
name=workflow_identifier)
raise ex
raise
class WorkflowConstraint(constraints.BaseCustomConstraint):

View File

@ -1734,7 +1734,7 @@ class Resource(object):
if self.client_plugin().is_not_found(ex):
raise exception.EntityNotFound(
entity='Resource', name=self.name)
raise ex
raise
return resource_data
def parse_live_resource_data(self, resource_properties, resource_data):

View File

@ -107,7 +107,7 @@ class Policy(resource.Resource):
self.client_plugin().is_not_found(ex)):
bd['finished'] = True
else:
raise ex
raise
def add_bindings(self, bindings):
for bd in bindings:

View File

@ -500,7 +500,7 @@ class OSDBInstance(resource.Resource):
LOG.warning(_LW("Unexpected instance state change "
"during update. Retrying."))
return False
raise exc
raise
return True
def _update_name(self, instance, name):

View File

@ -762,7 +762,7 @@ class Stack(collections.Mapping):
if ignorable_errors and ex.error_code in ignorable_errors:
result = None
else:
raise ex
raise
except AssertionError:
raise
except Exception as ex: