Skip to content

Commit

Permalink
[gitlab] Fix gitlab constants calls (#7467)
Browse files Browse the repository at this point in the history
fix: Fix gitlab constants calls

Co-authored-by: Arnaud Hatzenbuhler <[email protected]>
(cherry picked from commit a366318)
  • Loading branch information
Wihrt authored and patchback[bot] committed Nov 4, 2023
1 parent 01134d4 commit 60a36ca
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
5 changes: 5 additions & 0 deletions changelogs/fragments/7467-fix-gitlab-constants-calls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bugfixes:
- gitlab_group_members - fix gitlab constants call in ``gitlab_group_members`` module (https://github.com/ansible-collections/community.general/issues/7467).
- gitlab_project_members - fix gitlab constants call in ``gitlab_project_members`` module (https://github.com/ansible-collections/community.general/issues/7467).
- gitlab_protected_branches - fix gitlab constants call in ``gitlab_protected_branches`` module (https://github.com/ansible-collections/community.general/issues/7467).
- gitlab_user - fix gitlab constants call in ``gitlab_user`` module (https://github.com/ansible-collections/community.general/issues/7467).
10 changes: 5 additions & 5 deletions plugins/modules/gitlab_group_members.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,11 @@ def main():
ensure_gitlab_package(module)

access_level_int = {
'guest': gitlab.GUEST_ACCESS,
'reporter': gitlab.REPORTER_ACCESS,
'developer': gitlab.DEVELOPER_ACCESS,
'maintainer': gitlab.MAINTAINER_ACCESS,
'owner': gitlab.OWNER_ACCESS,
'guest': gitlab.const.GUEST_ACCESS,
'reporter': gitlab.const.REPORTER_ACCESS,
'developer': gitlab.const.DEVELOPER_ACCESS,
'maintainer': gitlab.const.MAINTAINER_ACCESS,
'owner': gitlab.const.OWNER_ACCESS,
}

gitlab_group = module.params['gitlab_group']
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/gitlab_project_members.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,10 @@ def main():
ensure_gitlab_package(module)

access_level_int = {
'guest': gitlab.GUEST_ACCESS,
'reporter': gitlab.REPORTER_ACCESS,
'developer': gitlab.DEVELOPER_ACCESS,
'maintainer': gitlab.MAINTAINER_ACCESS,
'guest': gitlab.const.GUEST_ACCESS,
'reporter': gitlab.const.REPORTER_ACCESS,
'developer': gitlab.const.DEVELOPER_ACCESS,
'maintainer': gitlab.const.MAINTAINER_ACCESS,
}

gitlab_project = module.params['project']
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/gitlab_protected_branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ def __init__(self, module, project, gitlab_instance):
self._module = module
self.project = self.get_project(project)
self.ACCESS_LEVEL = {
'nobody': gitlab.NO_ACCESS,
'developer': gitlab.DEVELOPER_ACCESS,
'maintainer': gitlab.MAINTAINER_ACCESS
'nobody': gitlab.const.NO_ACCESS,
'developer': gitlab.const.DEVELOPER_ACCESS,
'maintainer': gitlab.const.MAINTAINER_ACCESS
}

def get_project(self, project_name):
Expand Down
12 changes: 6 additions & 6 deletions plugins/modules/gitlab_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,12 @@ def __init__(self, module, gitlab_instance):
self._gitlab = gitlab_instance
self.user_object = None
self.ACCESS_LEVEL = {
'guest': gitlab.GUEST_ACCESS,
'reporter': gitlab.REPORTER_ACCESS,
'developer': gitlab.DEVELOPER_ACCESS,
'master': gitlab.MAINTAINER_ACCESS,
'maintainer': gitlab.MAINTAINER_ACCESS,
'owner': gitlab.OWNER_ACCESS,
'guest': gitlab.const.GUEST_ACCESS,
'reporter': gitlab.const.REPORTER_ACCESS,
'developer': gitlab.const.DEVELOPER_ACCESS,
'master': gitlab.const.MAINTAINER_ACCESS,
'maintainer': gitlab.const.MAINTAINER_ACCESS,
'owner': gitlab.const.OWNER_ACCESS,
}

'''
Expand Down

0 comments on commit 60a36ca

Please sign in to comment.