(opts, args) = parser.parse_args()
buildfarm = StormCachingBuildFarm(timeout=40.0)
-db = buildfarm.hostdb
smtp = smtplib.SMTP()
smtp.connect()
-hosts = db.dead_hosts(7 * 86400)
+hosts = buildfarm.hostdb.dead_hosts(7 * 86400)
for host in hosts:
if host.last_update:
last_update = time.strftime("%a %b %e %H:%M:%S %Y", time.gmtime(host.last_update))
msg["Subject"] ="Your build farm host %s appears dead" % host.name
msg["From"] = "\"Samba Build Farm\" <build@samba.org>"
msg["To"] = "\"%s\" <%s>" % host.owner
+ msg["Bcc"] = "\"Samba Build Farm\" <build@samba.org>"
if opts.dry_run:
print msg.as_string()
else:
- smtp.sendmail(msg["From"], [msg["To"]], msg.as_string())
+ smtp.sendmail(msg["From"], [msg["To"], msg["Bcc"]], msg.as_string())
host.dead_mail_sent()
-db.commit()
+buildfarm.commit()
smtp.quit()