[sysadmin-bin] Include emeritus members on the membership list json



commit 4a33ecf27a393d6425882a652949a41b2ce177dc
Author: Andrea Veri <averi redhat com>
Date:   Mon Jan 25 15:29:59 2021 +0100

    Include emeritus members on the membership list json

 membership/foundation-operations.py | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/membership/foundation-operations.py b/membership/foundation-operations.py
index efa4fd1..4c50f5e 100755
--- a/membership/foundation-operations.py
+++ b/membership/foundation-operations.py
@@ -106,15 +106,23 @@ def remove_expired_memberships_from_foundation():
 def generate_membership_list():
     import json
 
-    result = []
+    emeritus = glu.get_uids_from_group('emeritus')
+
+    result = { 'members': [], 'emeritus': [] }
 
     for member in foundationmembers:
         ldap_fields = glu.get_attributes_from_ldap(member, 'cn', 'LastRenewedOn')
         common_name_attr = ldap_fields[1].decode('utf-8')
         last_renewed_on_attr = ldap_fields[2].decode('utf-8')
 
-        d = { 'common_name' : common_name_attr, 'last_renewed_on' : last_renewed_on_attr }
-        result.append(d)
+        result['members'].append({ 'common_name' : common_name_attr, 'last_renewed_on' : 
last_renewed_on_attr })
+
+    for member in emeritus:
+        ldap_fields = glu.get_attributes_from_ldap(member, 'cn', 'LastRenewedOn')
+        common_name_attr = ldap_fields[1].decode('utf-8')
+        last_renewed_on_attr = ldap_fields[2].decode('utf-8')
+
+        result['emeritus'].append({ 'common_name' : common_name_attr, 'last_renewed_on' : 
last_renewed_on_attr })
 
     memberslist = json.dumps(result, ensure_ascii=False)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]