aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2018-04-03 10:27:27 +0200
committerTibor Frank <tifrank@cisco.com>2018-04-03 10:27:27 +0200
commite8cd12aa194876deb0d51bfdc504d8a8738a5d80 (patch)
treeafb553898bbf8406a87d453589978333cfeb477f /resources/tools
parentc0dd501b9c0a5e16c2d8f0e91e664cc9dcc04752 (diff)
CSIT Trending: Input files
Change-Id: I93728caccec332e05af30858dc83e85ab2af91fc Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools')
-rw-r--r--resources/tools/presentation/input_data_files.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/resources/tools/presentation/input_data_files.py b/resources/tools/presentation/input_data_files.py
index 1923dad965..b45d21ac66 100644
--- a/resources/tools/presentation/input_data_files.py
+++ b/resources/tools/presentation/input_data_files.py
@@ -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"