mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-18 16:31:26 -07:00
Gitlab variables pagination (#968)
* Workaround increasing per_page to max * Update plugins/modules/source_control/gitlab/gitlab_group_variable.py * Create 968-gitlab_variables-pagination-increase.yml * Update changelogs/fragments/968-gitlab_variables-pagination-increase.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update changelogs/fragments/968-gitlab_variables-pagination-increase.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Proper support of pagination * Fix E303 too many blank lines * Add test for pagination * Fix last vars removal test * Apply suggestions from code review Check misalignement fixed Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
3af4be34b2
commit
98486c0ee2
5 changed files with 170 additions and 8 deletions
|
@ -155,7 +155,14 @@ class GitlabProjectVariables(object):
|
|||
return self.repo.projects.get(project_name)
|
||||
|
||||
def list_all_project_variables(self):
|
||||
return self.project.variables.list()
|
||||
page_nb = 1
|
||||
variables = []
|
||||
vars_page = self.project.variables.list(page=page_nb)
|
||||
while len(vars_page) > 0:
|
||||
variables += vars_page
|
||||
page_nb += 1
|
||||
vars_page = self.project.variables.list(page=page_nb)
|
||||
return variables
|
||||
|
||||
def create_variable(self, key, value, masked, protected, variable_type):
|
||||
if self._module.check_mode:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue