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