From 10c49a6ad37748fd8c7bd68bee70bb39212cee81 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Wed, 8 Sep 2021 10:12:05 +0530 Subject: [PATCH] marvin: fix exception logging (#5401) Fixes #5203 Signed-off-by: Abhishek Kumar --- tools/marvin/marvin/cloudstackException.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/marvin/marvin/cloudstackException.py b/tools/marvin/marvin/cloudstackException.py index 2738cfb3527..57f9b037ac9 100644 --- a/tools/marvin/marvin/cloudstackException.py +++ b/tools/marvin/marvin/cloudstackException.py @@ -58,7 +58,12 @@ class internalError(Exception): def GetDetailExceptionInfo(e): if e is not None: - exc_type, exc_value, exc_traceback = sys.exc_info() + if type(e) is str: + return e + elif type(e) is tuple: + (exc_type, exc_value, exc_traceback) = e + else: + exc_type, exc_value, exc_traceback = sys.exc_info() return str(repr(traceback.format_exception( exc_type, exc_value, exc_traceback))) else: