mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-02-10 22:17:36 +00:00
email: Add more debugging when sending emails
We're currently spamming an uploader, and it's hard to figure out why. Let's output why we are deciding to do so.
This commit is contained in:
parent
e51cc58a2b
commit
879e7e1088
@ -232,8 +232,9 @@ class EmailPolicy(BasePolicy, Rest):
|
||||
recipients = ', '.join(emails)
|
||||
msg = MESSAGE.format(**locals())
|
||||
try:
|
||||
self.log("%s/%s stuck for %d days, emailing %s" %
|
||||
(source_name, version, age, recipients))
|
||||
self.log("%s/%s stuck for %d days (email last sent at %d days old, "
|
||||
"threshold for sending %d days), emailing %s" %
|
||||
(source_name, version, age, last_sent, last_due, recipients))
|
||||
server = smtplib.SMTP(self.email_host)
|
||||
server.sendmail('noreply@canonical.com', emails, msg)
|
||||
server.quit()
|
||||
|
Loading…
x
Reference in New Issue
Block a user