mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-13 07:25:10 +00:00
module utils: use f-strings (#10979)
* module utils: use f-strings * add changelog frag
This commit is contained in:
parent
b527e80307
commit
032d398c0a
6 changed files with 28 additions and 28 deletions
|
|
@ -53,7 +53,8 @@ def render(to_render):
|
|||
yield f"{key}=[{','.join(recurse(item))}]"
|
||||
continue
|
||||
if isinstance(value, str):
|
||||
yield '{0:}="{1:}"'.format(key, value.replace('\\', '\\\\').replace('"', '\\"'))
|
||||
_value = value.replace('\\', '\\\\').replace('"', '\\"')
|
||||
yield f'{key}="{_value}"'
|
||||
continue
|
||||
yield f'{key}="{value}"'
|
||||
return '\n'.join(recurse(to_render))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue