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:
parent
af246f8de3
commit
adcc683da7
45 changed files with 514 additions and 536 deletions
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue