1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-05-06 01:55:51 +00:00

modules r*: use f-strings (#10975)

* modules r*: use f-strings

* add changelog frag

* Apply suggestions from code review
This commit is contained in:
Alexei Znamensky 2025-10-26 19:48:33 +13:00 committed by GitHub
parent 749c06cd01
commit d51e4c188b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 153 additions and 155 deletions

View file

@ -112,7 +112,7 @@ class RundeckProjectManager(object):
def get_project_facts(self):
resp, info = api_request(
module=self.module,
endpoint="project/%s" % self.module.params["name"],
endpoint=f"project/{self.module.params['name']}",
)
return resp
@ -144,7 +144,7 @@ class RundeckProjectManager(object):
if info["status"] == 201:
self.module.exit_json(changed=True, before={}, after=self.get_project_facts())
else:
self.module.fail_json(msg="Unhandled HTTP status %d, please report the bug" % info["status"],
self.module.fail_json(msg=f"Unhandled HTTP status {info['status']}, please report the bug",
before={}, after=self.get_project_facts())
else:
self.module.exit_json(changed=False, before=facts, after=facts)
@ -158,7 +158,7 @@ class RundeckProjectManager(object):
if not self.module.check_mode:
api_request(
module=self.module,
endpoint="project/%s" % self.module.params["name"],
endpoint=f"project/{self.module.params['name']}",
method="DELETE",
)