[sysadmin-bin] Allow multiple maintainers per GNOME project



commit 4ee71f55976e820ad9ee0dc682dd769c5e7a712b
Author: Andrea Veri <averi redhat com>
Date:   Mon Aug 9 11:37:42 2021 +0200

    Allow multiple maintainers per GNOME project

 gitlab/gen-ldap-maint-list.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/gitlab/gen-ldap-maint-list.py b/gitlab/gen-ldap-maint-list.py
index c8c2fc8..6ab48d7 100755
--- a/gitlab/gen-ldap-maint-list.py
+++ b/gitlab/gen-ldap-maint-list.py
@@ -34,19 +34,23 @@ def gen_maints_list(gl_project_id, file_path):
     result = {}
 
     group = gl.groups.get(gl_project_id, with_projects=False)
-    projects = group.projects.list(all=True)
+    projects = group.projects.list(all=True, with_shared=False)
 
     for p in projects:
         _p = gl.projects.get(p.attributes['id'])
         members = _p.members.list()
 
-        result[_p.attributes['path_with_namespace']] = {}
-        result[_p.attributes['path_with_namespace']]['maintainers'] = {}
+        result[_p.attributes['path_with_namespace']] = dict()
+        result[_p.attributes['path_with_namespace']]['maintainers'] = list()
 
+        i = 0
         for maintainer in members:
             if maintainer.attributes['access_level'] == 40:
-                result[_p.attributes['path_with_namespace']]['maintainers']['gitlab_username'] = 
maintainer.attributes['username']
-                result[_p.attributes['path_with_namespace']]['maintainers']['ldap_username'] = 
find_ldap_uid(maintainer)
+                result[_p.attributes['path_with_namespace']]['maintainers'].append(dict())
+                result[_p.attributes['path_with_namespace']]['maintainers'][i]['gitlab_username'] = 
maintainer.attributes['username']
+                result[_p.attributes['path_with_namespace']]['maintainers'][i]['ldap_username'] = 
find_ldap_uid(maintainer)
+
+                i += 1
 
     with open(file_path, "w") as f:
         json.dump(result, f)


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