diff options
author | Pilou <pierre-louis@libregerbil.fr> | 2018-03-29 19:54:48 +0200 |
---|---|---|
committer | ansibot <ansibot@users.noreply.github.com> | 2018-03-29 19:54:48 +0200 |
commit | 7908f78fa6ba620b15c08ffb57f19631a2fe99ce (patch) | |
tree | 6057360767e0c0489d7672af3d5d93c1512aeec0 /hacking | |
parent | dedupe the --rsh options in favor of user supplied (#38096) (diff) | |
download | ansible-7908f78fa6ba620b15c08ffb57f19631a2fe99ce.tar.xz ansible-7908f78fa6ba620b15c08ffb57f19631a2fe99ce.zip |
module_common: handle None value for templar (#36651)
* module_common: set required parameter templar
Fix the following error (related to b455901):
$ ./hacking/test-module -m ./lib/ansible/modules/system/ping.py -I ansible_python_interpreter=/usr/bin/python
Traceback (most recent call last):
File "./hacking/test-module", line 268, in <module>
main()
File "./hacking/test-module", line 249, in main
(modfile, modname, module_style) = boilerplate_module(options.module_path, options.module_args, interpreters, options.check, options.filename)
File "./hacking/test-module", line 152, in boilerplate_module
task_vars=task_vars
File "ansible/lib/ansible/executor/module_common.py", line 910, in modify_module
environment=environment)
File "ansible/lib/ansible/executor/module_common.py", line 736, in _find_module_utils
shebang, interpreter = _get_shebang(u'/usr/bin/python', task_vars, templar)
File "ansible/lib/ansible/executor/module_common.py", line 452, in _get_shebang
interpreter = templar.template(task_vars[interpreter_config].strip())
AttributeError: 'NoneType' object has no attribute 'template'
* module_common.modify_module: templar is required
Diffstat (limited to 'hacking')
-rwxr-xr-x | hacking/test-module | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/hacking/test-module b/hacking/test-module index aecb6e9caf..aa51750057 100755 --- a/hacking/test-module +++ b/hacking/test-module @@ -42,6 +42,7 @@ from ansible.parsing.splitter import parse_kv import ansible.executor.module_common as module_common import ansible.constants as C from ansible.module_utils._text import to_native, to_text +from ansible.template import Templar try: import json @@ -149,6 +150,7 @@ def boilerplate_module(modfile, args, interpreters, check, destfile): modname, modfile, complex_args, + Templar(loader=loader), task_vars=task_vars ) |