aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/presentation/generator_alerts.py
diff options
context:
space:
mode:
authorViliam Luc <vluc@cisco.com>2021-12-16 09:22:43 +0100
committerViliam Luc <vluc@cisco.com>2021-12-17 11:17:23 +0100
commitd24bcf6e10fdee8e6ba1a0ef2f75e69d9e9d0a40 (patch)
treeae5eaff7d04a37fbe236ee8eb5f3b71fcf7ea593 /resources/tools/presentation/generator_alerts.py
parent0d576e9088c81ae1678c36f594336f18db53605b (diff)
trending: hotfix failing trending emails
Legend was showing for each job_name. When trying to fix it we broke the cpta with I/O operation. This fixes legend positioning and I/O operation error. Signed-off-by: Viliam Luc <vluc@cisco.com> Change-Id: I809daa3eabe6a728e5e183630fc7c6615dfef8bf
Diffstat (limited to 'resources/tools/presentation/generator_alerts.py')
-rw-r--r--resources/tools/presentation/generator_alerts.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/resources/tools/presentation/generator_alerts.py b/resources/tools/presentation/generator_alerts.py
index 9a0a03a59f..d22e7aa963 100644
--- a/resources/tools/presentation/generator_alerts.py
+++ b/resources/tools/presentation/generator_alerts.py
@@ -375,6 +375,30 @@ class Alerting:
)
text = u""
+
+ legend = (f"Legend:\n[ Last trend in Mpps | number of runs for "
+ f"last trend |")
+
+ out_file = (
+ f"{self.configs[alert[u'way']][u'output-dir']}/"
+ f"trending-regressions.txt"
+ )
+ try:
+ with open(out_file, u'w') as reg_file:
+ reg_file.write(f"{legend} regressions ]")
+ except IOError:
+ logging.error(f"Not possible to write the file {out_file}.txt.")
+
+ out_file = (
+ f"{self.configs[alert[u'way']][u'output-dir']}/"
+ f"trending-progressions.txt"
+ )
+ try:
+ with open(out_file, u'w') as reg_file:
+ reg_file.write(f"{legend} progressions ]")
+ except IOError:
+ logging.error(f"Not possible to write the file {out_file}.txt.")
+
for idx, test_set in enumerate(alert.get(u"include", list())):
test_set_short = u""
device = u""