1 # vi: encoding=utf-8 ts=8 sts=4 sw=4 et
10 # this module, as it deals with internal error handling shouldn't
11 # import anything beside status
18 m.set_headers(to = status.admin, cc = "%s, %s" % (status.email, status.builder_list), subject = "fatal python exception")
19 m.write("%s\n" % trace)
20 m.write("during: %s\n" % status.get())
24 # don't use mailer.py; it safer this way
25 f = os.popen("/usr/sbin/sendmail -i -t", "w")
26 f.write("""Subject: builder failure
30 X-PLD-Builder: fatal error report
35 """ % (status.admin, status.email, status.builder_list,
36 time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()),
44 exctype, value = sys.exc_info()[:2]
45 if exctype == SystemExit:
47 s = StringIO.StringIO()
48 traceback.print_exc(file = s, limit = 20)
50 log.alert("fatal python exception")
51 log.alert(s.getvalue())
52 log.alert("during: %s" % status.get())
54 sendmail(s.getvalue())