Reformat everything.

This commit is contained in:
Felix Fontein
2025-11-01 12:08:41 +01:00
parent 3f2213791a
commit 340ff8586d
1008 changed files with 61301 additions and 58309 deletions

View File

@@ -94,7 +94,10 @@ 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, find_project, list_all_kwargs
auth_argument_spec,
gitlab_authentication,
find_project,
list_all_kwargs,
)
@@ -149,18 +152,15 @@ def absent_strategy(module, gl, project, wished_badge):
return changed, None
state_strategy = {
"present": present_strategy,
"absent": absent_strategy
}
state_strategy = {"present": present_strategy, "absent": absent_strategy}
def core(module):
# check prerequisites and connect to gitlab server
gl = gitlab_authentication(module)
gitlab_project = module.params['project']
state = module.params['state']
gitlab_project = module.params["project"]
state = module.params["state"]
project = find_project(gl, gitlab_project)
# project doesn't exist
@@ -180,27 +180,29 @@ def core(module):
def main():
argument_spec = basic_auth_argument_spec()
argument_spec.update(auth_argument_spec())
argument_spec.update(dict(
project=dict(type='str', required=True),
state=dict(type='str', default='present', choices=['present', 'absent']),
link_url=dict(type='str', required=True),
image_url=dict(type='str', required=True),
))
argument_spec.update(
dict(
project=dict(type="str", required=True),
state=dict(type="str", default="present", choices=["present", "absent"]),
link_url=dict(type="str", required=True),
image_url=dict(type="str", required=True),
)
)
module = AnsibleModule(
argument_spec=argument_spec,
mutually_exclusive=[
['api_username', 'api_token'],
['api_username', 'api_oauth_token'],
['api_username', 'api_job_token'],
['api_token', 'api_oauth_token'],
['api_token', 'api_job_token'],
["api_username", "api_token"],
["api_username", "api_oauth_token"],
["api_username", "api_job_token"],
["api_token", "api_oauth_token"],
["api_token", "api_job_token"],
],
required_together=[
['api_username', 'api_password'],
["api_username", "api_password"],
],
required_one_of=[
['api_username', 'api_token', 'api_oauth_token', 'api_job_token'],
["api_username", "api_token", "api_oauth_token", "api_job_token"],
],
supports_check_mode=True,
)
@@ -208,5 +210,5 @@ def main():
core(module)
if __name__ == '__main__':
if __name__ == "__main__":
main()