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:
parent
749c06cd01
commit
d51e4c188b
22 changed files with 153 additions and 155 deletions
|
|
@ -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",
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue