summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2008-07-26 00:10:38 -0400
committerJesse Keating <jkeating@redhat.com>2008-07-26 00:10:38 -0400
commita3b9e743734b35702b9b1d203236b2d8cb2d0c15 (patch)
treeba710309b47ab9ca1061fcbcaa7de0f86ab6515d
parent35f35300e0dfc89502c390f91862c221f4cd5316 (diff)
downloadreleng-a3b9e743734b35702b9b1d203236b2d8cb2d0c15.tar.gz
releng-a3b9e743734b35702b9b1d203236b2d8cb2d0c15.tar.xz
releng-a3b9e743734b35702b9b1d203236b2d8cb2d0c15.zip
Add a function to send mail directly to those interested in a package
as well as the person who did the build that broke the upgrade path.
-rwxr-xr-xscripts/check-upgrade-paths.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/scripts/check-upgrade-paths.py b/scripts/check-upgrade-paths.py
index 8dc529d..40bf1cd 100755
--- a/scripts/check-upgrade-paths.py
+++ b/scripts/check-upgrade-paths.py
@@ -24,6 +24,13 @@
import koji
import rpm
import sys
+import smtplib
+import datetime
+
+fromaddr = 'buildsys@fedoraproject.org'
+toaddr = 'fedora-devel-list@fedoraproject.org'
+domain = '@fedoraproject.org'
+smtpserver = 'localhost'
def usage():
print """
@@ -46,6 +53,33 @@ def buildToNvr(build):
else:
return build['nvr']
+def genPackageMail(builder, package):
+ """Send a mail to the package watchers and the builder regarding the break.
+ Mail is set out once per broken package."""
+
+ # This relies on the package-owner alias sets
+ addresses = [builder, '%s-owner']
+ msg = """From: %s
+To: %s
+Subject: Broken upgrade path(s) detected for: %s
+
+""" % (fromaddr, ','.join([addy+domain for addy in addresses]), package)
+
+ for path in badpaths[pkg]:
+ msg += " %s\n" % path
+
+ msg += "\n\nPlease fix the(se) issue(s) as soon as possible.\n"
+
+ msg += "\n---------------\n"
+ msg += "This report generated by Fedora Release Engineering, using http://git.fedorahosted.org/git/?p=releng;a=blob;f=scripts/check-upgrade-paths.py;hb=HEAD"
+
+ try:
+ server = smtplib.SMTP(smtpserver)
+ server.set_debuglevel(1)
+ server.sendmail(fromaddr, [addy+domain for addy in addresses], msg)
+ except:
+ print 'sending mail failed'
+
if len(sys.argv) > 1 and sys.argv[1] in ['-h', '--help', '-help', '--usage']:
usage()
sys.exit(0)