mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -07:00
Fixes #12076
This commit is contained in:
parent
17060f9849
commit
1f7b0fee0a
1 changed files with 4 additions and 2 deletions
|
@ -188,9 +188,11 @@ def modify_module(module_path, module_args, task_vars=dict(), strip_comments=Fal
|
||||||
interpreter = to_bytes(task_vars[interpreter_config], errors='strict')
|
interpreter = to_bytes(task_vars[interpreter_config], errors='strict')
|
||||||
lines[0] = shebang = b"#!{0} {1}".format(interpreter, b" ".join(args[1:]))
|
lines[0] = shebang = b"#!{0} {1}".format(interpreter, b" ".join(args[1:]))
|
||||||
|
|
||||||
|
if interpreter.startswith('python'):
|
||||||
lines.insert(1, ENCODING_STRING)
|
lines.insert(1, ENCODING_STRING)
|
||||||
else:
|
else:
|
||||||
lines.insert(0, ENCODING_STRING)
|
# No shebang, assume a binary module?
|
||||||
|
pass
|
||||||
|
|
||||||
module_data = b"\n".join(lines)
|
module_data = b"\n".join(lines)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue