[Buildbot-devel] Problem with Using MailNotifier

Nikunj Badjatya nikunjbadjatya at gmail.com
Thu May 12 04:39:02 UTC 2011


Dear Members,

I have recently started to use Buildbot for my C library build purpose.
I am using "MailNotifier" for triggering automatic mails at various stages
of the build.

Buildbot version: 0.7.12
Twisted version: 9.0.0
Python version 2.6.6
CentOS 5.6

*Q.1)*
The following code snippet is failing to send a mail.
{{{
*from buildbot.status.mail import MailNotifier
from buildbot.status.builder import Results
def messageformatter(mode, name, build, results, master_status):
 result = Results[results]

 text = list()
 text.append('Testing Mail Trigger..cooperate')
 text.append("name of builder:"% name)
 text.append("URL            :"% master_status.getURLForThing(build))
 text.append("slavename      :"% build.getSlavename())
 text.append("STATUS         : %s" % result.title())
 return {
         'body' : "\n".join(text),
         'type' : 'plain'
 }

mn = MailNotifier(fromaddr="buildmaster at localhost",
                           sendToInterestedUsers=False,
                           subject='Testing Buildbot Mail Trigger',
                           mode='all',
                           extraRecipients=['abc at xxx.com'],
                           messageFormatter=messageformatter)*
...
...
c['status'].append(mn)

}}}

But when I simply use:
{{{
*
ml = MailNotifier(fromaddr="buildmaster at localhost",
                  sendToInterestedUsers=False,
                  subject='Testing Buildbot Mail Trigger',
                  extraRecipients=['abc at xyz.com'],
                  )*
...
...
c['status'].append(ml)

}}}

It could send a mail. !

*Q.2)*
Is it possible to trigger a mail just before sometime ( say 1 hr ) the build
process starts.?? Please guide as to how it can be accomplished.!



Please help to solve these .!


Thanks,

Nikunj
Bangalore, India
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20110512/6f0d2888/attachment.html>


More information about the devel mailing list