CSIT Trending: Input files 82/11482/1
authorTibor Frank <tifrank@cisco.com>
Tue, 3 Apr 2018 08:27:27 +0000 (10:27 +0200)
committerTibor Frank <tifrank@cisco.com>
Tue, 3 Apr 2018 08:27:27 +0000 (10:27 +0200)
Change-Id: I93728caccec332e05af30858dc83e85ab2af91fc
Signed-off-by: Tibor Frank <tifrank@cisco.com>
resources/tools/presentation/input_data_files.py

index 1923dad..b45d21a 100644 (file)
@@ -81,6 +81,14 @@ def download_data_files(spec):
             try:
                 response = get(url, stream=True)
                 code = response.status_code
+
+                # temporary workaround, remove when output.log.xml is not needed
+                if code != codes["OK"] and \
+                        spec.input["file-name"].endswith(".gz"):
+                    url = '.'.join(url.split('.')[:-1]) + ".log.gz"
+                    response = get(url, stream=True)
+                    code = response.status_code
+
                 if code != codes["OK"]:
                     logging.warning(
                         "Jenkins: {0}: {1}.".format(code, responses[code]))
@@ -145,7 +153,7 @@ def download_data_files(spec):
                 elif spec.input["file-name"].endswith(".gz"):
                     rename(new_name, new_name[:-3])
                     with open(new_name[:-3], 'r') as xml_file:
-                        with gzip.open(new_name, 'wb') as gz_file:
+                        with gzip.open(new_name, 'w') as gz_file:
                             gz_file.write(xml_file.read())
                     new_name = new_name[:-3]
                     status = "downloaded"

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.