Protect if detail is returned as None 81/73181/2
authorCédric Ollivier <cedric.ollivier@orange.com>
Fri, 21 Jan 2022 10:08:50 +0000 (11:08 +0100)
committerCédric Ollivier <cedric.ollivier@orange.com>
Fri, 21 Jan 2022 13:05:58 +0000 (14:05 +0100)
It occured when running ansible.

Change-Id: I908270fdb76fbc3bdf60787b189cdbc29c41b52b
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit 769898458263b7f138c7ffc9126c376781fa71d4)

xtesting/core/testcase.py

index 8faf3f4..bccf76d 100644 (file)
@@ -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)):