community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1790677 - /comdev/projects.apache.org/scripts/cronjobs/parsecommitters.py
Date Sat, 08 Apr 2017 12:56:37 GMT
Author: sebb
Date: Sat Apr  8 12:56:37 2017
New Revision: 1790677

URL: http://svn.apache.org/viewvc?rev=1790677&view=rev
Log:
Allow for references to missing people from all LDAP groups (not just non-LDAP)

Modified:
    comdev/projects.apache.org/scripts/cronjobs/parsecommitters.py

Modified: comdev/projects.apache.org/scripts/cronjobs/parsecommitters.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/cronjobs/parsecommitters.py?rev=1790677&r1=1790676&r2=1790677&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/cronjobs/parsecommitters.py (original)
+++ comdev/projects.apache.org/scripts/cronjobs/parsecommitters.py Sat Apr  8 12:56:37 2017
@@ -48,14 +48,19 @@ people = {} # key: availid, value: array
 groups = {} # key: group name (-pmc suffix if relevant), value: array of availids
 people_name = {} # key: id, value: public name
 
-def addPersonGroup(p):
+def addPersonGroup(p, gname, gtype):
+    if not p in ldappeople:
+        print("ERROR: %s group '%s' has entry '%s' not in people LDAP group" % (gtype, gname,
p), file=sys.stderr)
+        name = '(Missing from LDAP people)'
+    else:
+        name = ldappeople[p]['name']
     # only add people to the name list if they are referenced
     if not p in people_name:
-        people_name[p] = ldappeople[p]['name']
+        people_name[p] = name
     if not p in people:
         people[p] = {'groups':[],
                      'member' : p in memberinfo,
-                     'name': ldappeople[p]['name'] # use full list as disabled entries may
be referenced
+                     'name': name
                      }
     return people[p]['groups']
 
@@ -72,22 +77,18 @@ nonldapgroups = loadJson('https://whimsy
 for g in nonldapgroups:
     groups[g] = nonldapgroups[g]['roster']
     for p in nonldapgroups[g]['roster']:
-        # N.B. non-LDAP groups can contain invalid entries; check this
-        if not p in ldappeople:
-            print("ERROR: non-LDAP group '%s' has entry '%s' not in people LDAP group" %
(g, p), file=sys.stderr)
-        else:
-            addPersonGroup(p).append(g)
+        addPersonGroup(p,g,'non-LDAP').append(g)
 
 for g in ldapgroups:
     if not g == 'committers':
         groups[g] = ldapgroups[g]['roster']
         for p in ldapgroups[g]['roster']:
-            addPersonGroup(p).append(g)
+            addPersonGroup(p,g,'LDAP unix').append(g)
 
 for g in ldapcttees:
     groups[g+'-pmc'] = ldapcttees[g]['roster']
     for p in ldapcttees[g]['roster']:
-        addPersonGroup(p).append(g+'-pmc')
+        addPersonGroup(p,g,'LDAP committee').append(g+'-pmc')
     
 # Now sort the groups arrays
 for p in people:



Mime
View raw message