Skip to content
Snippets Groups Projects
Commit f09fddc6 authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Display in email consecutive errors count.

parent 2e2c0384
No related branches found
No related tags found
No related merge requests found
...@@ -48,7 +48,7 @@ class Tester(): ...@@ -48,7 +48,7 @@ class Tester():
-h: show this message.''' % __file__ -h: show this message.''' % __file__
VALID_ARGS = ['-e', '-f', '-b', '-d', '-h'] VALID_ARGS = ['-e', '-f', '-b', '-d', '-h']
MAX_LOG_FILES = 50 MAX_LOG_FILES = 50
NO_MAIL_FAILURES_COUNT = 30 NO_MAIL_FAILURES_COUNT = 5
def __init__(self, *args): def __init__(self, *args):
log('\033[96m-------------------------------\033[0m') log('\033[96m-------------------------------\033[0m')
...@@ -338,13 +338,15 @@ class Tester(): ...@@ -338,13 +338,15 @@ class Tester():
else: else:
break break
if consecutive_failures == self.NO_MAIL_FAILURES_COUNT: 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 send_email = True
elif consecutive_failures < self.NO_MAIL_FAILURES_COUNT: 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 send_email = True
else: 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: if send_email:
recipients = utils.get_conf('EMAIL_ADMINS') recipients = utils.get_conf('EMAIL_ADMINS')
system_domain = utils.get_conf('MS_SERVER_NAME') system_domain = utils.get_conf('MS_SERVER_NAME')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment