[sysadmin-bin] Also populate the gitlab_username field



commit e84be56eef904f644ddf09a3e8706f20a7862537
Author: Andrea Veri <averi redhat com>
Date:   Thu Jul 29 16:00:35 2021 +0200

    Also populate the gitlab_username field

 gitlab/gen-ldap-maint-list.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gitlab/gen-ldap-maint-list.py b/gitlab/gen-ldap-maint-list.py
index 57f429a..c8c2fc8 100755
--- a/gitlab/gen-ldap-maint-list.py
+++ b/gitlab/gen-ldap-maint-list.py
@@ -41,11 +41,12 @@ def gen_maints_list(gl_project_id, file_path):
         members = _p.members.list()
 
         result[_p.attributes['path_with_namespace']] = {}
-        result[_p.attributes['path_with_namespace']]['maintainers'] = []
+        result[_p.attributes['path_with_namespace']]['maintainers'] = {}
 
         for maintainer in members:
             if maintainer.attributes['access_level'] == 40:
-                result[_p.attributes['path_with_namespace']]['maintainers'].append(find_ldap_uid(maintainer))
+                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)
 
     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]