From f09fddc602f25826027b945fb4250f5b7542cff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu> Date: Fri, 12 May 2017 09:55:04 +0200 Subject: [PATCH] Display in email consecutive errors count. --- tester.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tester.py b/tester.py index 53cf6e72..b1e7db96 100755 --- a/tester.py +++ b/tester.py @@ -48,7 +48,7 @@ class Tester(): -h: show this message.''' % __file__ VALID_ARGS = ['-e', '-f', '-b', '-d', '-h'] MAX_LOG_FILES = 50 - NO_MAIL_FAILURES_COUNT = 30 + NO_MAIL_FAILURES_COUNT = 5 def __init__(self, *args): log('\033[96m-------------------------------\033[0m') @@ -338,13 +338,15 @@ class Tester(): else: break if consecutive_failures == self.NO_MAIL_FAILURES_COUNT: - log('Maximum consecutive tester failures reached (%s).\nNo more emails will be sent.' % consecutive_failures) + consecutive_msg = 'Maximum consecutive tester failures reached (%s).\nNo more emails will be sent.' % consecutive_failures send_email = True elif consecutive_failures < self.NO_MAIL_FAILURES_COUNT: - log('Consecutive tester failures: %s.' % consecutive_failures) + consecutive_msg = 'Consecutive tester failures: %s.' % consecutive_failures send_email = True else: - log('Too many consecutive tester failures: %s, no email will be sent.' % consecutive_failures) + consecutive_msg = 'Too many consecutive tester failures: %s, no email will be sent.' % consecutive_failures + log(consecutive_msg) + html_report += '\n<br/>' + consecutive_msg.replace('\n', '\n<br/>') if send_email: recipients = utils.get_conf('EMAIL_ADMINS') system_domain = utils.get_conf('MS_SERVER_NAME') -- GitLab