aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/presentation/generator_alerts.py
diff options
context:
space:
mode:
Diffstat (limited to 'resources/tools/presentation/generator_alerts.py')
-rw-r--r--resources/tools/presentation/generator_alerts.py10
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"]))