You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mitogen/tests/ansible/lib/modules
David Wilson f9e1905ec6 issue #199: ansible: stop writing temp files for new style modules
While adding support for non-new style module types, NewStyleRunner
began writing modules to a temporary file, and sys.argv was patched to
actually include the script filename. The argv change was never required
to fix any particular bug, and a search of the standard modules reveals
no argv users. Update argv[0] to be '', like an interactive interpreter
would have.

While fixing #210, new style runner began setting __file__ to the
temporary file path in order to allow apt.py to discover the Ansiballz
temporary directory. 5 out of 1,516 standard modules follow this
pattern, but in each case, none actually attempt to access __file__,
they just call dirname on it. Therefore do not write the contents of
file, simply set it to the path as it would exist, within a real
temporary directory.

Finally move temporary directory creation out of runner and into target.
Now a single directory exists for the duration of a run, and is emptied
by runner.py as necessary after each task invocation.

This could be further extended to stop rewriting non-new-style modules
in a with_items loop, but that's another step.

Finally the last bullet point in the documentation almost isn't a lie
again.
8 years ago
..
bash_return_paths.sh issue #164: rename lib/modules 8 years ago
custom_bash_old_style_module.sh issue #195: handle non-ASCII scripts in runner.py. 8 years ago
custom_bash_want_json_module.sh issue #164: rename lib/modules 8 years ago
custom_binary_single_null issue #164: rename lib/modules 8 years ago
custom_perl_json_args_module.pl issue #164: rename lib/modules 8 years ago
custom_perl_want_json_module.pl issue #164: rename lib/modules 8 years ago
custom_python_detect_environment.py issue #199: ansible: stop writing temp files for new style modules 8 years ago
custom_python_json_args_module.py issue #164: rename lib/modules 8 years ago
custom_python_leaky_class_vars.py tests: clean up remaining reg tests 8 years ago
custom_python_new_style_missing_interpreter.py ansible: disable script interpreter processing for new-style 8 years ago
custom_python_new_style_module.py Ensure mod.__file__ is set; closes #210. 8 years ago
custom_python_want_json_module.py issue #164: rename lib/modules 8 years ago