diff options
author | Pilou <pierre-louis@libregerbil.fr> | 2018-09-19 16:10:55 +0200 |
---|---|---|
committer | ansibot <ansibot@users.noreply.github.com> | 2018-09-19 16:10:55 +0200 |
commit | 60160c1e904462290e1214f6237060eab25b14bf (patch) | |
tree | 6e1b48a0707d7d9ec924387129dcb5c67392ad10 /test/integration/targets/test_infra | |
parent | fix nxos_facts indefinite hang for text based output (#45845) (diff) | |
download | ansible-60160c1e904462290e1214f6237060eab25b14bf.tar.xz ansible-60160c1e904462290e1214f6237060eab25b14bf.zip |
doc: exercising module code locally: update cmd (#45697)
The documented way to execute module code locally wasn't always working:
$ python ./lib/ansible/modules/files/file.py <<< '{"ANSIBLE_MODULE_ARGS": {}}'
Traceback (most recent call last):
File "./lib/ansible/modules/files/file.py", line 177, in <module>
from ansible.module_utils.basic import AnsibleModule
File "~/ansible/lib/ansible/module_utils/basic.py", line 78, in <module>
import tempfile
File "~/ansible/lib/ansible/modules/files/tempfile.py", line 69, in <module>
from tempfile import mkstemp, mkdtemp
ImportError: cannot import name 'mkstemp'
Diffstat (limited to 'test/integration/targets/test_infra')
-rwxr-xr-x | test/integration/targets/test_infra/runme.sh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/integration/targets/test_infra/runme.sh b/test/integration/targets/test_infra/runme.sh index be3809f95b..caa33fff3b 100755 --- a/test/integration/targets/test_infra/runme.sh +++ b/test/integration/targets/test_infra/runme.sh @@ -25,3 +25,6 @@ echo "$PB_OUT" | grep -F "assert works (True)" || exit 1 # ensure test-module script works well PING_MODULE_PATH="$(pwd)/../../../../lib/ansible/modules/system/ping.py" ../../../../hacking/test-module -m "$PING_MODULE_PATH" -I ansible_python_interpreter="$(which python)" + +# ensure exercising module code locally works +python -m ansible.modules.files.file <<< '{"ANSIBLE_MODULE_ARGS": {"path": "/path/to/file", "state": "absent"}}' |