summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)