From c5f17f21849279ab757770b86e8718a6d0ff5851 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sat, 24 Jul 2021 21:24:18 +0200 Subject: [PATCH] gitlab_group_members/gitlab_project_members - fix pagination issue (#3054) (#3061) * Fix * fixed linter stuff * typo in section name of changlog fragment Co-authored-by: Max Bidlingmaier (cherry picked from commit d057b2e3b262af437b0115622069a60580919173) Co-authored-by: Max Bidlingmaier --- .../3041-fix_gitlab_group_members_gitlab_project_mambers.yml | 3 +++ plugins/modules/source_control/gitlab/gitlab_group_members.py | 2 +- .../modules/source_control/gitlab/gitlab_project_members.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/3041-fix_gitlab_group_members_gitlab_project_mambers.yml diff --git a/changelogs/fragments/3041-fix_gitlab_group_members_gitlab_project_mambers.yml b/changelogs/fragments/3041-fix_gitlab_group_members_gitlab_project_mambers.yml new file mode 100644 index 0000000000..d1be8b78d3 --- /dev/null +++ b/changelogs/fragments/3041-fix_gitlab_group_members_gitlab_project_mambers.yml @@ -0,0 +1,3 @@ +bugfixes: + - gitlab_group_members - fixes issue when gitlab group has more then 20 members, pagination problem (https://github.com/ansible-collections/community.general/issues/3041). + - gitlab_project_members - fixes issue when gitlab group has more then 20 members, pagination problem (https://github.com/ansible-collections/community.general/issues/3041). diff --git a/plugins/modules/source_control/gitlab/gitlab_group_members.py b/plugins/modules/source_control/gitlab/gitlab_group_members.py index 8a3da2a41b..50779e6445 100644 --- a/plugins/modules/source_control/gitlab/gitlab_group_members.py +++ b/plugins/modules/source_control/gitlab/gitlab_group_members.py @@ -109,7 +109,7 @@ class GitLabGroup(object): # get all members in a group def get_members_in_a_group(self, gitlab_group_id): group = self._gitlab.groups.get(gitlab_group_id) - return group.members.list() + return group.members.list(all=True) # check if the user is a member of the group def is_user_a_member(self, members, gitlab_user_id): diff --git a/plugins/modules/source_control/gitlab/gitlab_project_members.py b/plugins/modules/source_control/gitlab/gitlab_project_members.py index 8e23dca426..0ae8f4b25c 100644 --- a/plugins/modules/source_control/gitlab/gitlab_project_members.py +++ b/plugins/modules/source_control/gitlab/gitlab_project_members.py @@ -130,7 +130,7 @@ class GitLabProjectMembers(object): # get all members in a project def get_members_in_a_project(self, gitlab_project_id): project = self._gitlab.projects.get(gitlab_project_id) - return project.members.list() + return project.members.list(all=True) # check if the user is a member of the project def is_user_a_member(self, members, gitlab_user_id):