mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
modules bc*: use f-strings (#10945)
* modules bc*: use f-strings * no quotes or backticks inside f-strs * add changelog frag * rename chglof frag file * rename chglof frag file * copr: re-applied change maintain original logic
This commit is contained in:
@@ -125,12 +125,12 @@ class ConsulBindingRuleModule(_ConsulModule):
|
||||
unique_identifiers = ["id"]
|
||||
|
||||
def read_object(self):
|
||||
url = "acl/binding-rules?authmethod={0}".format(self.params["auth_method"])
|
||||
url = f"acl/binding-rules?authmethod={self.params['auth_method']}"
|
||||
try:
|
||||
results = self.get(url)
|
||||
for result in results:
|
||||
if result.get("Description").startswith(
|
||||
"{0}: ".format(self.params["name"])
|
||||
f"{self.params['name']}: "
|
||||
):
|
||||
return result
|
||||
except RequestError as e:
|
||||
@@ -149,7 +149,7 @@ class ConsulBindingRuleModule(_ConsulModule):
|
||||
final = super(ConsulBindingRuleModule, self).prepare_object(existing, obj)
|
||||
name = self.params["name"]
|
||||
description = final.pop("Description", "").split(": ", 1)[-1]
|
||||
final["Description"] = "{0}: {1}".format(name, description)
|
||||
final["Description"] = f"{name}: {description}"
|
||||
return final
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user