changeset 272:72645086a0b7

* hook up email, i hope * fix failing tests, i also hope
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 31 Jul 2012 13:42:47 -0700
parents 13107cdc1e33
children fce509d75f3b
files autobot/template.py autobot/template/master/master.cfg
diffstat 2 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/autobot/template.py	Tue Jul 31 13:15:40 2012 -0700
+++ b/autobot/template.py	Tue Jul 31 13:42:47 2012 -0700
@@ -50,7 +50,7 @@
             Variable('ircHost', 'IRC host', default='irc.mozilla.org'),
             Variable('ircChannels', 'channels for the IRC bot ("-" for none)', default='#ateam-test'), # use #ateam in production
             Variable('domain', 'autobot domain name', default='localhost'),
-            Variable('recipients', 'email recipients for all projects')
+            Variable('recipients', 'email recipients for all projects', '')
             ]
 
     def pre(self, variables, output):
--- a/autobot/template/master/master.cfg	Tue Jul 31 13:15:40 2012 -0700
+++ b/autobot/template/master/master.cfg	Tue Jul 31 13:42:47 2012 -0700
@@ -121,7 +121,22 @@
         c['status'].append(words.IRC(host=irc_host, nick=nick,
                                      channels=config.master['channels']))
 
-# email notification
+# email notification; see
+# http://buildbot.net/buildbot/docs/latest/reference/buildbot.status.mail.MailNotifier-class.html
+# http://buildbot.net/buildbot/docs/0.7.1/#Defining-Status-Targets
+fromaddr = config.master.get('email', '')
+recipients = config.master.get('recipients', None)
+if recipients:
+    recipients = recipients.split()
+else:
+    recipients = []
+if fromaddr:
+    from buildbot.status import mail
+    m = mail.MailNotifier(fromaddr=fromaddr,
+                          mode=["problem"],
+                          extraRecipients=recipients
+                          sendToInterestedUsers=True)
+     c['status'].append(m)
 
 # autolog
 #from autobot.status import autolog