Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions github_user_management/check_github_users_in_ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ def check_github_usernames(github_token, ldap_url, ldap_base, github_url, org):
gc = github_client.GithubClient(github_token, github_url)

members = dict(
map(lambda x: (x.lower(), "github"), gc.get_members(org))
map(lambda x: (x.lower(), "only_in_github"), gc.get_members(org))
)

with ldap_client.LdapClient(ldap_url, ldap_base) as lc:
for user, shell, github_user in lc.get_github_users():
github_user = github_user.lower()
if shell == '/dev/null':
if github_user in members:
if github_user in members and members[github_user] == 'only_in_github':
members[github_user] = 'github_user_that_quit'
continue
if github_user not in members:
Expand All @@ -45,5 +45,5 @@ def check_github_usernames(github_token, ldap_url, ldap_base, github_url, org):

print_dict_keys_per_value(
members, ("matching", "to_add_to_github"),
("github", "github_user_that_quit")
("only_in_github", "github_user_that_quit")
)