From 879e7e10882dcd4940625d38e5dfb5387aac849d Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Mon, 12 Aug 2019 15:27:58 +0100 Subject: [PATCH] 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. --- britney2/policies/email.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/britney2/policies/email.py b/britney2/policies/email.py index 5d10ed3..07212e1 100644 --- a/britney2/policies/email.py +++ b/britney2/policies/email.py @@ -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()