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

modules [t-z]*: use f-strings (#10978)

* modules [t-z]*: use f-strings

* add changelog frag

* remove extraneous file
This commit is contained in:
Alexei Znamensky 2025-10-26 22:36:03 +13:00 committed by GitHub
parent af246f8de3
commit adcc683da7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 514 additions and 536 deletions

View file

@ -79,7 +79,7 @@ def parse_lsusb(module, lsusb_path):
for line in stdout.splitlines():
match = re.match(regex, line)
if not match:
module.fail_json(msg="failed to parse unknown lsusb output %s" % (line), stdout=stdout, stderr=stderr)
module.fail_json(msg=f"failed to parse unknown lsusb output {line}", stdout=stdout, stderr=stderr)
current_device = {
'bus': match.group(1),
'device': match.group(2),
@ -90,7 +90,7 @@ def parse_lsusb(module, lsusb_path):
return_value = {
"usb_devices": usb_devices
}
module.exit_json(msg="parsed %s USB devices" % (len(usb_devices)), stdout=stdout, stderr=stderr, ansible_facts=return_value)
module.exit_json(msg=f"parsed {len(usb_devices)} USB devices", stdout=stdout, stderr=stderr, ansible_facts=return_value)
def main():