modules [no]*: use f-strings (#10973)

* modules [no]*: use f-strings

* add changelog frag
This commit is contained in:
Alexei Znamensky
2025-10-26 19:48:10 +13:00
committed by GitHub
parent 50846b7560
commit 749c06cd01
44 changed files with 399 additions and 412 deletions

View File

@@ -199,7 +199,7 @@ class TemplateModule(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
@@ -254,7 +254,7 @@ class TemplateModule(OpenNebulaModule):
def create_template(self, name, template_data, filter):
if not self.module.check_mode:
self.one.template.allocate("NAME = \"" + name + "\"\n" + template_data)
self.one.template.allocate(f'NAME = "{name}"\n{template_data}')
result = self.get_template_info(self.get_template_by_name(name, filter))
result['changed'] = True