mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
[PR #7486/4a74f46e backport][stable-8] refactor(gitlab modules): remove duplicate gitlab package check (#7516)
refactor(gitlab modules): remove duplicate gitlab package check (#7486)
(cherry picked from commit 4a74f46e56)
Co-authored-by: Léo GATELLIER <26511053+lgatellier@users.noreply.github.com>
This commit is contained in:
@@ -163,7 +163,7 @@ from ansible.module_utils.api import basic_auth_argument_spec
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.gitlab import (
|
||||
auth_argument_spec, gitlab_authentication, gitlab, ensure_gitlab_package
|
||||
auth_argument_spec, gitlab_authentication, gitlab
|
||||
)
|
||||
|
||||
|
||||
@@ -279,7 +279,9 @@ def main():
|
||||
],
|
||||
supports_check_mode=True,
|
||||
)
|
||||
ensure_gitlab_package(module)
|
||||
|
||||
# check prerequisites and connect to gitlab server
|
||||
gl = gitlab_authentication(module)
|
||||
|
||||
access_level_int = {
|
||||
'guest': gitlab.const.GUEST_ACCESS,
|
||||
@@ -296,9 +298,6 @@ def main():
|
||||
if purge_users:
|
||||
purge_users = [access_level_int[level] for level in purge_users]
|
||||
|
||||
# connect to gitlab server
|
||||
gl = gitlab_authentication(module)
|
||||
|
||||
project = GitLabProjectMembers(module, gl)
|
||||
|
||||
gitlab_project_id = project.get_project(gitlab_project)
|
||||
|
||||
Reference in New Issue
Block a user