Commit f344f5b2 authored by Nicolas Delaby's avatar Nicolas Delaby Committed by Arnaud Fontaine

- Put result summary in beginning of subject emails for fast reading.

- return subject in output stream


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils/erp5.utils.web_checker/@37710 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 88d44296
...@@ -395,10 +395,9 @@ class HTTPCacheCheckerTestSuite(object): ...@@ -395,10 +395,9 @@ class HTTPCacheCheckerTestSuite(object):
else: else:
report_message = 'No errors' report_message = 'No errors'
signal = 'OK' signal = 'OK'
subject = '%r:HTTP Cache checker results for %s' % (signal, self.root_url)
if self.email_address: if self.email_address:
import smtplib import smtplib
subject = 'HTTP Cache checker results for %s: %s' % (self.root_url,
signal)
message = 'Subject: %s\nFrom: %s\nTo: %s\n\n%s' %\ message = 'Subject: %s\nFrom: %s\nTo: %s\n\n%s' %\
(subject, self.email_address, self.email_address, report_message) (subject, self.email_address, self.email_address, report_message)
server = smtplib.SMTP(self.smtp_host) server = smtplib.SMTP(self.smtp_host)
...@@ -406,7 +405,7 @@ class HTTPCacheCheckerTestSuite(object): ...@@ -406,7 +405,7 @@ class HTTPCacheCheckerTestSuite(object):
server.quit() server.quit()
return 'Email sended to %s' % self.email_address return 'Email sended to %s' % self.email_address
else: else:
return report_message return subject + '\n' + report_message
from optparse import OptionParser from optparse import OptionParser
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment