You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by se...@apache.org on 2023/09/09 16:09:02 UTC

svn commit: r1912218 - /comdev/projects.apache.org/trunk/scripts/cronjobs/parseprojects.py

Author: sebb
Date: Sat Sep  9 16:09:02 2023
New Revision: 1912218

URL: http://svn.apache.org/viewvc?rev=1912218&view=rev
Log:
Don't clutter site-dev

Modified:
    comdev/projects.apache.org/trunk/scripts/cronjobs/parseprojects.py

Modified: comdev/projects.apache.org/trunk/scripts/cronjobs/parseprojects.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/trunk/scripts/cronjobs/parseprojects.py?rev=1912218&r1=1912217&r2=1912218&view=diff
==============================================================================
--- comdev/projects.apache.org/trunk/scripts/cronjobs/parseprojects.py (original)
+++ comdev/projects.apache.org/trunk/scripts/cronjobs/parseprojects.py Sat Sep  9 16:09:02 2023
@@ -64,7 +64,7 @@ def validate(json, tag, valid, pid, url)
         for val in invals:
             canon = valid.get(val.lower())
             if canon is None:
-                printMail(f"ERROR: unexpected value '{val}' for {pid} in {url}")#, project=pid)
+                printNotice(f"ERROR: unexpected value '{val}' for {pid} in {url}")#, project=pid)
                 outvals.append(val) # TODO flag this to show invalid entries
             elif canon != val:
                 print(f"WARN: '{val}' should be '{canon}' for {pid} in {url}")
@@ -129,6 +129,22 @@ def printMail(msg, file=sys.stdout, body
     except ConnectionRefusedError:
         print(f"*** Failed to send the email to {recipients}", file=file)
 
+# Print to log and send a notice email
+def printNotice(msg, file=sys.stdout, body='', project=None):
+    print(msg, file=file)
+    if body == None: # sendmail barfs if body is missing
+        body = ''
+    if body == '':
+        body=msg
+    recipients = 'notifications@community.apache.org'
+    if project != None:
+        domain = mailDomains.get(project, project)
+        recipients = [f'private@{domain}.apache.org', recipients]
+    try:
+        sendmail.sendMail(msg, body=body, recipients=recipients)
+    except ConnectionRefusedError:
+        print(f"*** Failed to send the email to {recipients}", file=file)
+
 ATTIC = 'Attic <ge...@attic.apache.org>'
 # Print to log and send a conditional email to Attic
 def printAtticMail(msg, file=sys.stdout):