Fixing mistakes from last attempt. Things should be OK now.
This commit is contained in:
parent
42027ddf8d
commit
1e3c3def7c
1 changed files with 12 additions and 6 deletions
18
master.cfg
18
master.cfg
|
@ -139,15 +139,17 @@ import smtplib
|
|||
import socket
|
||||
from email.mime.text import MIMEText
|
||||
|
||||
def SendRootMessageGDBTesters (branch, rev, change):
|
||||
def SendRootMessageGDBTesters (branch, change):
|
||||
global GDB_MAIL_TO, GDB_MAIL_FROM
|
||||
rev = change.revision
|
||||
f = "/tmp/gdb-buildbot-%s.lock" % rev
|
||||
|
||||
if os.path.exists (f):
|
||||
# The message has already been sent
|
||||
return
|
||||
|
||||
open ("/tmp/%s" % rev, 'w').close ()
|
||||
# WE HAVE TO REMEMBER TO CLEAN THESE FILES REGULARLY
|
||||
open (f, 'w').close ()
|
||||
|
||||
text = ""
|
||||
text += "*** TEST RESULTS FOR COMMIT %s ***\n\n" % rev
|
||||
|
@ -156,13 +158,15 @@ def SendRootMessageGDBTesters (branch, rev, change):
|
|||
text += "Branch: %s\n" % branch
|
||||
text += "Commit: %s\n\n" % rev
|
||||
|
||||
text += change.comments + "\n"
|
||||
text += change.comments + "\n\n"
|
||||
|
||||
text += change.patch + "\n"
|
||||
|
||||
mail = MIMEText (text)
|
||||
mail['Subject'] = "Test results for commit %s on branch %s" % (rev, branch)
|
||||
mail['From'] = GDB_MAIL_FROM
|
||||
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.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."""
|
||||
git_url = "http://gdb-build.sergiodj.net/cgit"
|
||||
branch = build.getSourceStamps ()[0].branch
|
||||
cur_change = build.getSourceStamps ()[0].changes[0]
|
||||
|
||||
# Sending the root message to gdb-testers.
|
||||
SendRootMessageGDBTesters (branch, name, ss_list[0].changes[0])
|
||||
SendRootMessageGDBTesters (branch, cur_change)
|
||||
|
||||
# Subject
|
||||
subj = "Failures on %s, branch %s" % (name, branch)
|
||||
|
@ -286,7 +291,8 @@ mn = mail.MailNotifier(fromaddr = GDB_MAIL_FROM,
|
|||
mode = ('failing'),
|
||||
messageFormatter = MessageGDBTesters,
|
||||
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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue