[PR #11396/c8356981 backport][stable-12] move imports from functions to the top of the file (#11399)

move imports from functions to the top of the file (#11396)

* move imports from functions to the top of the file

* add changelog frag

* Apply suggestions from code review



---------


(cherry picked from commit c8356981bb)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot]
2026-01-07 21:27:49 +01:00
committed by GitHub
parent 6169699b24
commit e3535de323
7 changed files with 21 additions and 27 deletions

View File

@@ -103,6 +103,7 @@ output:
import json
from http import cookiejar
from string import Template
from urllib.parse import urlencode
from ansible.module_utils.basic import AnsibleModule
@@ -153,8 +154,6 @@ def main():
module.params["force_basic_auth"] = True
if module.params["args"] is not None:
from string import Template
try:
script_contents = Template(module.params["script"]).substitute(module.params["args"])
except KeyError as err: