Remove self from group after group creation
Newer gerrit automatically adds the user creating a group to that group. We don't actually want this behavior as the user used to manage this is used for nothing else. Check if the current user was added to the group and if so remove it. Depends-On: Id5d8915f2c0bf6f6057b414785b8ec1b18e810f2 Change-Id: Ia0ca5faaaa466ae7a930bbbfb78e2975771f3af9
This commit is contained in:
parent
e8da5932e1
commit
87b466c0c5
@ -209,6 +209,11 @@ def get_group_uuid(gerrit, group):
|
|||||||
if group in GERRIT_SYSTEM_GROUPS:
|
if group in GERRIT_SYSTEM_GROUPS:
|
||||||
return GERRIT_SYSTEM_GROUPS[group]
|
return GERRIT_SYSTEM_GROUPS[group]
|
||||||
gerrit.createGroup(group)
|
gerrit.createGroup(group)
|
||||||
|
for user in gerrit.listMembers(group):
|
||||||
|
if gerrit.username == user['username']:
|
||||||
|
# Gerrit now adds creating user to groups. We don't want that.
|
||||||
|
gerrit.removeMember(group, gerrit.username)
|
||||||
|
break
|
||||||
uuid = _get_group_uuid(group)
|
uuid = _get_group_uuid(group)
|
||||||
if uuid:
|
if uuid:
|
||||||
return uuid
|
return uuid
|
||||||
|
Loading…
Reference in New Issue
Block a user