From f7d436ed9c2a994e3b91a5233c0bb61566d86ed5 Mon Sep 17 00:00:00 2001 From: gengchc2 Date: Fri, 26 Aug 2016 11:31:14 +0800 Subject: [PATCH] Correct freezer 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: Ic071e958694166a7df87915f50fe0f4a70f01fab --- freezer/storage/swift.py | 4 ++-- freezer/utils/streaming.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/freezer/storage/swift.py b/freezer/storage/swift.py index df945bb7..11ae5249 100644 --- a/freezer/storage/swift.py +++ b/freezer/storage/swift.py @@ -36,8 +36,8 @@ class SwiftStorage(physical.PhysicalStorage): prefix=split[1])[1]: try: self.swift().delete_object(split[0], file['name']) - except Exception as e: - raise e + except Exception: + raise def put_file(self, from_path, to_path): self.client_manager.create_swift() diff --git a/freezer/utils/streaming.py b/freezer/utils/streaming.py index 9f2a4713..6e4cd4a9 100644 --- a/freezer/utils/streaming.py +++ b/freezer/utils/streaming.py @@ -113,4 +113,4 @@ class QueuedThread(threading.Thread): self.rich_queue.force_stop() # Thread will exit at this point. # @todo print the error using traceback.print_exc(file=sys.stdout) - raise e + raise