aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2018-04-03 12:22:26 +0200
committerTibor Frank <tifrank@cisco.com>2018-04-03 12:22:26 +0200
commitc623ad8042127fcb4bbd3c9ffb646f40371b7510 (patch)
treea5f7185eb83038dd6c58aa9f4b8c87290cf7c608 /resources/tools
parente8cd12aa194876deb0d51bfdc504d8a8738a5d80 (diff)
CSIT Trending: Input files
Change-Id: I4cfaaff8a372dbf807715ec47647fbe8760dbe6b Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools')
-rw-r--r--resources/tools/presentation/generator_CPTA.py2
-rw-r--r--resources/tools/presentation/input_data_files.py7
2 files changed, 2 insertions, 7 deletions
diff --git a/resources/tools/presentation/generator_CPTA.py b/resources/tools/presentation/generator_CPTA.py
index f3a8c010c5..69c52d4180 100644
--- a/resources/tools/presentation/generator_CPTA.py
+++ b/resources/tools/presentation/generator_CPTA.py
@@ -424,8 +424,6 @@ def _generate_all_charts(spec, input_data):
idx += 1
# Generate the chart:
- period_name = "Daily" if period == 1 else \
- "Weekly" if period < 20 else "Monthly"
_generate_chart(traces,
chart["layout"],
file_name="{0}-{1}-{2}{3}".format(
diff --git a/resources/tools/presentation/input_data_files.py b/resources/tools/presentation/input_data_files.py
index b45d21ac66..6abb3250e7 100644
--- a/resources/tools/presentation/input_data_files.py
+++ b/resources/tools/presentation/input_data_files.py
@@ -23,13 +23,12 @@ from os import rename, remove
from os.path import join, getsize
from shutil import move
from zipfile import ZipFile, is_zipfile, BadZipfile
-
from httplib import responses
from requests import get, codes, RequestException, Timeout, TooManyRedirects, \
HTTPError, ConnectionError
from errors import PresentationError
-
+from utils import execute_command
# Chunk size used for file download
CHUNK_SIZE = 512
@@ -152,9 +151,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, 'w') as gz_file:
- gz_file.write(xml_file.read())
+ execute_command("gzip --keep {0}".format(new_name[:-3]))
new_name = new_name[:-3]
status = "downloaded"
logging.info("{0}: {1}".format(code, responses[code]))