mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-18 16:31:26 -07:00
refactor(gitlab modules): remove duplicate gitlab package check (#7486)
This commit is contained in:
parent
6b00b76f32
commit
4a74f46e56
17 changed files with 63 additions and 65 deletions
|
@ -152,7 +152,7 @@ from ansible.module_utils.common.text.converters import to_native, to_text
|
|||
|
||||
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
|
||||
from ansible_collections.community.general.plugins.module_utils.gitlab import (
|
||||
auth_argument_spec, gitlab_authentication, gitlab, ensure_gitlab_package, find_project
|
||||
auth_argument_spec, gitlab_authentication, gitlab, find_project
|
||||
)
|
||||
|
||||
|
||||
|
@ -321,7 +321,9 @@ def main():
|
|||
],
|
||||
supports_check_mode=True
|
||||
)
|
||||
ensure_gitlab_package(module)
|
||||
|
||||
# check prerequisites and connect to gitlab server
|
||||
gitlab_instance = gitlab_authentication(module)
|
||||
|
||||
project = module.params['project']
|
||||
source_branch = module.params['source_branch']
|
||||
|
@ -341,8 +343,6 @@ def main():
|
|||
module.fail_json(msg="community.general.gitlab_merge_request requires python-gitlab Python module >= 2.3.0 (installed version: [%s])."
|
||||
" Please upgrade python-gitlab to version 2.3.0 or above." % gitlab_version)
|
||||
|
||||
gitlab_instance = gitlab_authentication(module)
|
||||
|
||||
this_project = find_project(gitlab_instance, project)
|
||||
if this_project is None:
|
||||
module.fail_json(msg="Failed to get the project: %s" % project)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue