mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
gitlab: Use all=True
in most list()
calls (#4491)
If `all=True` is not set then by default only 20 records will be returned when calling `list()`. Use `all=True` so that all records will be returned. For the `list()` use where do not desire to retrieve all entries then use`all=False` to show explicityly that we don't want to get all of the entries. Fixes: #3729 Fixes: #4460
This commit is contained in:
parent
e4a25beedc
commit
fe4bbc5de3
7 changed files with 33 additions and 10 deletions
|
@ -178,12 +178,12 @@ class GitLabProjectMembers(object):
|
|||
project_exists = self._gitlab.projects.get(project_name)
|
||||
return project_exists.id
|
||||
except gitlab.exceptions.GitlabGetError as e:
|
||||
project_exists = self._gitlab.projects.list(search=project_name)
|
||||
project_exists = self._gitlab.projects.list(search=project_name, all=False)
|
||||
if project_exists:
|
||||
return project_exists[0].id
|
||||
|
||||
def get_user_id(self, gitlab_user):
|
||||
user_exists = self._gitlab.users.list(username=gitlab_user)
|
||||
user_exists = self._gitlab.users.list(username=gitlab_user, all=False)
|
||||
if user_exists:
|
||||
return user_exists[0].id
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue