diff options
author | Tibor Frank <tifrank@cisco.com> | 2018-09-18 12:50:16 +0200 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2018-09-18 14:13:47 +0200 |
commit | 5ad9b364cbd45a0b25d73412b9777ac14df92b0a (patch) | |
tree | bb1c836a98bf98423855df6056eb4379fe70e6d4 /resources/tools/presentation/generator_alerts.py | |
parent | 9440d0f9cfca758b48297350bba52d853cc483ef (diff) |
CSIT-1288: Prepare data to be sent by Jenkins
- Add creation of tar.gz file
Change-Id: I525c713bb3e157cd94337222781066252c3fa517
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/presentation/generator_alerts.py')
-rw-r--r-- | resources/tools/presentation/generator_alerts.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/resources/tools/presentation/generator_alerts.py b/resources/tools/presentation/generator_alerts.py index 71913eb0b5..77302b6168 100644 --- a/resources/tools/presentation/generator_alerts.py +++ b/resources/tools/presentation/generator_alerts.py @@ -18,6 +18,7 @@ from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from os.path import isdir +from utils import execute_command from errors import PresentationError @@ -262,6 +263,15 @@ class Alerting(object): except IOError: logging.error("Not possible to write the file '{0}.html'.". format(file_name)) + + zip_file = config.get("zip-output", None) + if zip_file: + logging.info("Writing the file '{0}/{1}' ...". + format(config["output-dir"], zip_file)) + execute_command("tar czvf {dir}/{zip} {dir}/{input}.*".format( + dir=config["output-dir"], + zip=zip_file, + input=config["output-file"])) else: raise AlertingError("Alert of type '{0}' is not implemented.". format(alert["type"])) |