From dea6ebf05f8d63f4466efc331f1c92a201289620 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Sun, 21 Dec 2014 19:38:24 -0500 Subject: [PATCH] First attempt of a mail notifier --- master.cfg | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/master.cfg b/master.cfg index f10cdf4..3569ff1 100644 --- a/master.cfg +++ b/master.cfg @@ -102,15 +102,32 @@ c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg)) #c['status'].append(words.IRC(host="irc.yyz.redhat.com", nick="sdj-gdbbot", # channels=["#gdbbuild"])) -#from buildbot.status import mail -#mn = mail.MailNotifier(fromaddr="sergiodj@redhat.com", -# sendToInterestedUsers=False, -# extraRecipients=['gdb-testers@sourceware.org'], -# relayhost="smtp.corp.redhat.com", -# mode=('failing'), -# smtpPort=25) +def MessageGDBTesters (mode, name, build, results, master_status): + """This function is responsible for composing the message that will be +send to the gdb-testers mailing list.""" + ss_list = build.getSourceStamps () + subj = "Failures on %s" % name + text = list () + parser = DejaResults () + text.append ("Commit(s) tested:\n") + for ss in ss_list: + text.append ("\t%s\n" % ss.revision) + text.append ("\n") + text.append (build.getLog ('regressions').getText ()) + return { 'body' : text, + 'type' : 'plain', + 'subject' : subj } -#c['status'].append(mn) +from buildbot.status import mail +mn = mail.MailNotifier(fromaddr = "sergiodj@redhat.com", + sendToInterestedUsers = False, + extraRecipients = ['sergiodj@redhat.com'], +# extraRecipients = ['gdb-testers@sourceware.org'], + relayhost = "smtp.corp.redhat.com", + mode = ('failing'), + smtpPort = 25) + +c['status'].append (mn) c['title'] = "GDB" c['titleURL'] = "https://gnu.org/s/gdb"