From e7af04409a60d7ffc703dd7ec67ec1a9bd936ab4 Mon Sep 17 00:00:00 2001 From: Tianhao He Date: Tue, 26 Feb 2019 17:39:24 +0800 Subject: [PATCH] Remove try/catch block from sample_base.py There is an bug in the catch block where the exception didn't get re-raised when cleanup is false. When something goes wrong, it's better to leave the setup as is for dubugging. Thus removing the try/catch. Signed-off-by: Tianhao He --- samples/vsphere/common/sample_base.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/samples/vsphere/common/sample_base.py b/samples/vsphere/common/sample_base.py index 62386755..b67ebe7d 100644 --- a/samples/vsphere/common/sample_base.py +++ b/samples/vsphere/common/sample_base.py @@ -75,14 +75,7 @@ class SampleBase(object): for name in dir(self): attr = getattr(self, name) if callable(attr) and name == '_execute': - try: - attr() # calling the method - except Exception as e: - # print the exception and move on to the cleanup stage if cleardata is set to True. - traceback.print_exc() - if bool(self.cleardata) is not True: - # re-throw the exception - raise Exception(e) + attr() # calling the method def after(self): if bool(self.cleardata) is True: