summaryrefslogtreecommitdiffstats
path: root/meta/classes/poky-autobuild-notifier.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/poky-autobuild-notifier.bbclass')
-rw-r--r--meta/classes/poky-autobuild-notifier.bbclass62
1 files changed, 0 insertions, 62 deletions
diff --git a/meta/classes/poky-autobuild-notifier.bbclass b/meta/classes/poky-autobuild-notifier.bbclass
deleted file mode 100644
index 9ab3d064ed..0000000000
--- a/meta/classes/poky-autobuild-notifier.bbclass
+++ /dev/null
@@ -1,62 +0,0 @@
1#
2# Copyright Openedhand Ltd 2008
3# Author: Richard Purdie
4#
5
6# Designed for use with the Poky autobuilder only and provides custom hooks for
7# certain specific events.
8
9def do_autobuilder_failure_report(event):
10 from bb.event import getName
11 from bb import data, mkdirhier, build
12 import os, glob
13
14 if data.getVar('PN', event.data, True) != "clutter":
15 return
16
17 import smtplib
18 import email.Message
19
20 version = data.expand("${PN}: ${PV}-${PR}", event.data)
21
22 recipients = ["richard@o-hand.com"]
23 COMMASPACE = ', '
24
25 message = email.Message.Message()
26 message["To"] = COMMASPACE.join(recipients)
27 message["From"] = "Poky Autobuilder Failure <poky@o-hand.com>"
28 message["Subject"] = "Poky Autobuild Failure Report - " + version
29
30 mesg = "Poky Build Failure for:\n\n"
31
32 for var in ["DISTRO", "MACHINE", "PN", "PV", "PR"]:
33 mesg += var + ": " + data.getVar(var, event.data, True) + "\n"
34
35 mesg += "\nLog of the failure follows:\n\n"
36
37 log_file = glob.glob("%s/log.%s.*" % (data.getVar('T', event.data, True), event.task))
38 if len(log_file) != 0:
39 mesg += "".join(open(log_file[0], 'r').readlines())
40
41 message.set_payload(mesg)
42
43 mailServer = smtplib.SMTP("pug.o-hand.com")
44 mailServer.sendmail(message["From"], recipients, message.as_string())
45 mailServer.quit()
46
47# we want to be an event handler
48addhandler poky_autobuilder_notifier_eventhandler
49python poky_autobuilder_notifier_eventhandler() {
50 from bb import note, error, data
51 from bb.event import getName
52
53 if e.data is None:
54 return
55
56 name = getName(e)
57
58 if name == "TaskFailed":
59 do_autobuilder_failure_report(e)
60
61 return
62}