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: I69e007566bf26fa2d4b6bcd1f996f4bba9f49049
This commit is contained in:
yuyafei 2016-07-07 18:52:45 +08:00
parent 2f24f400c8
commit 43f99362c0
2 changed files with 3 additions and 3 deletions

View File

@ -203,7 +203,7 @@ class OSClientManager(object):
time.sleep(5)
except Exception as e:
if str(e) == "snapshot has error state":
raise e
raise
LOG.exception(e)
return snapshot
@ -250,7 +250,7 @@ class OSClientManager(object):
raise Exception("Image have killed state")
except Exception as e:
if image.status in ("killed", "deleted"):
raise e
raise
LOG.exception(e)
LOG.warn("Exception getting image status")
return image

View File

@ -112,4 +112,4 @@ class QueuedThread(threading.Thread):
self._exception_queue.put_nowait(e)
self.rich_queue.force_stop()
# Thread will exit at this point.
raise e
raise