Fixing mistakes from last attempt. Things should be OK now.

This commit is contained in:
Sergio Durigan Junior 2015-02-08 03:49:33 -05:00
parent 42027ddf8d
commit 1e3c3def7c

View file

@ -139,15 +139,17 @@ import smtplib
import socket import socket
from email.mime.text import MIMEText from email.mime.text import MIMEText
def SendRootMessageGDBTesters (branch, rev, change): def SendRootMessageGDBTesters (branch, change):
global GDB_MAIL_TO, GDB_MAIL_FROM global GDB_MAIL_TO, GDB_MAIL_FROM
rev = change.revision
f = "/tmp/gdb-buildbot-%s.lock" % rev f = "/tmp/gdb-buildbot-%s.lock" % rev
if os.path.exists (f): if os.path.exists (f):
# The message has already been sent # The message has already been sent
return return
open ("/tmp/%s" % rev, 'w').close () # WE HAVE TO REMEMBER TO CLEAN THESE FILES REGULARLY
open (f, 'w').close ()
text = "" text = ""
text += "*** TEST RESULTS FOR COMMIT %s ***\n\n" % rev text += "*** TEST RESULTS FOR COMMIT %s ***\n\n" % rev
@ -156,13 +158,15 @@ def SendRootMessageGDBTesters (branch, rev, change):
text += "Branch: %s\n" % branch text += "Branch: %s\n" % branch
text += "Commit: %s\n\n" % rev text += "Commit: %s\n\n" % rev
text += change.comments + "\n" text += change.comments + "\n\n"
text += change.patch + "\n"
mail = MIMEText (text) mail = MIMEText (text)
mail['Subject'] = "Test results for commit %s on branch %s" % (rev, branch) mail['Subject'] = "Test results for commit %s on branch %s" % (rev, branch)
mail['From'] = GDB_MAIL_FROM mail['From'] = GDB_MAIL_FROM
mail['To'] = GDB_MAIL_TO mail['To'] = GDB_MAIL_TO
mail['Message-Id'] = "%s@%s" (rev, socket.gethostname ()) mail['Message-Id'] = "<%s@%s>" % (rev, socket.gethostname ())
s = smtplib.SMTP ('localhost') s = smtplib.SMTP ('localhost')
s.sendmail (GDB_MAIL_FROM, [ GDB_MAIL_TO ], mail.as_string ()) s.sendmail (GDB_MAIL_FROM, [ GDB_MAIL_TO ], mail.as_string ())
@ -173,9 +177,10 @@ def MessageGDBTesters (mode, name, build, results, master_status):
send to the gdb-testers mailing list.""" send to the gdb-testers mailing list."""
git_url = "http://gdb-build.sergiodj.net/cgit" git_url = "http://gdb-build.sergiodj.net/cgit"
branch = build.getSourceStamps ()[0].branch branch = build.getSourceStamps ()[0].branch
cur_change = build.getSourceStamps ()[0].changes[0]
# Sending the root message to gdb-testers. # Sending the root message to gdb-testers.
SendRootMessageGDBTesters (branch, name, ss_list[0].changes[0]) SendRootMessageGDBTesters (branch, cur_change)
# Subject # Subject
subj = "Failures on %s, branch %s" % (name, branch) subj = "Failures on %s, branch %s" % (name, branch)
@ -286,7 +291,8 @@ mn = mail.MailNotifier(fromaddr = GDB_MAIL_FROM,
mode = ('failing'), mode = ('failing'),
messageFormatter = MessageGDBTesters, messageFormatter = MessageGDBTesters,
extraHeaders = { 'X-GDB-Buildbot' : '1', extraHeaders = { 'X-GDB-Buildbot' : '1',
'In-Reply-To' : WithProperties ("%(got_revision)s@%s" % socket.gethostname ()) }) 'In-Reply-To' : WithProperties ("<%s@" + socket.gethostname () + ">",
'got_revision') })
c['status'].append (mn) c['status'].append (mn)