mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-21 03:09:04 +00:00
modules [no]*: use f-strings (#10973)
* modules [no]*: use f-strings * add changelog frag
This commit is contained in:
parent
50846b7560
commit
749c06cd01
44 changed files with 399 additions and 412 deletions
|
|
@ -297,7 +297,7 @@ class NetworksModule(OpenNebulaModule):
|
|||
needs_creation = False
|
||||
if not template and desired_state != 'absent':
|
||||
if id:
|
||||
module.fail_json(msg="There is no template with id=" + str(id))
|
||||
module.fail_json(msg=f"There is no template with id={id}")
|
||||
else:
|
||||
needs_creation = True
|
||||
|
||||
|
|
@ -394,7 +394,7 @@ class NetworksModule(OpenNebulaModule):
|
|||
def create_template(self, name, template_data):
|
||||
if not self.module.check_mode:
|
||||
# -1 means that network won't be added to any cluster which happens by default
|
||||
self.one.vn.allocate("NAME = \"" + name + "\"\n" + template_data, -1)
|
||||
self.one.vn.allocate(f'NAME = "{name}"\n{template_data}', -1)
|
||||
|
||||
result = self.get_template_info(self.get_template_by_name(name))
|
||||
result['changed'] = True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue