Skip to content

Commit

Permalink
remove useless condition and simplify the method to get group's members
Browse files Browse the repository at this point in the history
  • Loading branch information
Solvik committed Aug 21, 2024
1 parent 45b1227 commit 85ec271
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions gitlab2rbac.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,8 @@ def _get_users_query_paginated(
raw = gql_client.execute(
query, variable_values=variable_values, parse_result=True
)
results = raw.get("group").get("groupMembers")
nodes = results.get("nodes")
page_info = results.get("pageInfo")
nodes = []
page_info = {"hasNextPage": True}
while page_info.get("hasNextPage"):
variable_values["after"] = page_info.get("endCursor")
results = (
Expand Down Expand Up @@ -293,10 +292,7 @@ def get_groups(self):
timespent = time() - _start
logging.debug(f"Fetched groups in {timespent} seconds")
for result in gitlab_groups:
if (
result.parent_id is None
and result.name not in self.groups_ignore_list
):
if result.name not in self.groups_ignore_list:
logging.info("|found group={}".format(result.name))
groups.append(result)
return groups
Expand Down

0 comments on commit 85ec271

Please sign in to comment.