community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1743044 - /comdev/reporter.apache.org/trunk/scripts/parsepmcs.py
Date Mon, 09 May 2016 20:39:22 GMT
Author: sebb
Date: Mon May  9 20:39:22 2016
New Revision: 1743044

URL: http://svn.apache.org/viewvc?rev=1743044&view=rev
Log:
Send mail for WARN message

Modified:
    comdev/reporter.apache.org/trunk/scripts/parsepmcs.py

Modified: comdev/reporter.apache.org/trunk/scripts/parsepmcs.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/scripts/parsepmcs.py?rev=1743044&r1=1743043&r2=1743044&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/scripts/parsepmcs.py (original)
+++ comdev/reporter.apache.org/trunk/scripts/parsepmcs.py Mon May  9 20:39:22 2016
@@ -38,6 +38,15 @@ from urlutils import UrlCache
 import json
 import time
 import re
+import sendmail
+
+# Print to log and send an email (intended for WARN messages)
+def printMail(msg, file=sys.stdout):
+    print(msg, file=file)
+    try:
+        sendmail.sendMail(msg)
+    except ConnectionRefusedError:
+        print("*** Failed to send the email")
 
 uc = UrlCache(interval=0)
 
@@ -130,7 +139,7 @@ for nongroup in sorted(nonldapgroups):
 #        else:
 #            print("Not found non-ldap group %s" % nongroup)
     else:
-        print("WARN: unexpected non-ldap group %s in projects list " % nongroup)
+        printMail("WARN: unexpected non-ldap group '%s' in projects list " % nongroup)
 
 # Delete retired members
 ret = 0
@@ -220,7 +229,6 @@ DEST='Site Development <site-dev@apache.
 if len(chairDiffs) == 0:
     print("foundation/index.mdtext list of chairs agrees with committee-info")
 else:
-    import sendmail
     print("WARN: foundation/index.mdtext list of chairs disagrees with committee-info:")
     for m in chairDiffs:
         print(m)



Mime
View raw message