1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-02-04 07:51:50 +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

@ -163,7 +163,7 @@ class Zfs(object):
elif prop == 'volblocksize':
cmd += ['-b', value]
else:
cmd += ['-o', '%s=%s' % (prop, value)]
cmd += ['-o', f'{prop}={value}']
if origin and action == 'clone':
cmd.append(origin)
cmd.append(self.name)
@ -182,7 +182,7 @@ class Zfs(object):
if self.module.check_mode:
self.changed = True
return
cmd = [self.zfs_cmd, 'set', prop + '=' + str(value), self.name]
cmd = [self.zfs_cmd, 'set', f"{prop}={value!s}", self.name]
self.module.run_command(cmd, check_rc=True)
def set_properties_if_changed(self):
@ -200,7 +200,7 @@ class Zfs(object):
for prop in self.extra_zfs_properties:
value = self.get_property(prop, updated_properties)
if value is None:
self.module.fail_json(msg="zfsprop was not present after being successfully set: %s" % prop)
self.module.fail_json(msg=f"zfsprop was not present after being successfully set: {prop}")
if self.get_property(prop, current_properties) != value:
self.changed = True
if prop in diff['after']['extra_zfs_properties']: