From: Cédric Ollivier Date: Fri, 21 Jan 2022 10:08:50 +0000 (+0100) Subject: Protect if detail is returned as None X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F81%2F73181%2F2;p=functest-xtesting.git Protect if detail is returned as None It occured when running ansible. Change-Id: I908270fdb76fbc3bdf60787b189cdbc29c41b52b Signed-off-by: Cédric Ollivier (cherry picked from commit 769898458263b7f138c7ffc9126c376781fa71d4) --- diff --git a/xtesting/core/testcase.py b/xtesting/core/testcase.py index 8faf3f43..bccf76d2 100644 --- a/xtesting/core/testcase.py +++ b/xtesting/core/testcase.py @@ -305,6 +305,8 @@ class TestCase(): path = urllib.parse.urlparse(dst_s3_url).path.strip("/") dst_http_url = os.environ["HTTP_DST_URL"] output_str = "\n" + # protects if test cases return details as None + self.details = self.details or {} self.details["links"] = [] for log_file in [self.output_log_name, self.output_debug_log_name]: if os.path.exists(os.path.join(self.dir_results, log_file)):