Commit Graph

9 Commits (87aa59af79fd2f8f74935795f60818bf0278cdc0)

Author SHA1 Message Date
Matt Martz 87aa59af79 Legacy pep8 updates for setup.py and tests 7 years ago
Matt Clay 272ff10fa1 Fix @contextmanager leak on exception. (#21031)
* Fix @contextmanager leak on exception.
* Fix test leaks of global module args cache.
7 years ago
Toshio Kuratomi 186337db28 Ship constants to the modules via internal module params rather than a secondary dict. 8 years ago
nitzmahone 5b336832af add _load_params debug overrides for module args/file passed on cmdline
Updated python module wrapper explode method to drop 'args' file next to module.
Both execute() and excommunicate() debug methods now pass the module args via file to enable debuggers that are picky about stdin.
Updated unit tests to use a context manager for masking/restoring default streams and argv.
8 years ago
Toshio Kuratomi 75546678d9 Fix unittests 8 years ago
Toshio Kuratomi 4b0aa1214c Ziploader
* Ziploader proof of concept (jimi-c)

* Cleanups to proof of concept ziploader branch:

* python3 compatible base64 encoding
* zipfile compression (still need to enable toggling this off for
  systems without zlib support in python)
* Allow non-wildcard imports (still need to make this recusrsive so that
  we can have module_utils code that imports other module_utils code.)
* Better tracebacks: module filename is kept and module_utils directory
  is kept so that tracebacks show the real filenames that the errors
  appear in.

* Make sure we import modules that are used into the module_utils files that they are used in.

* Set ansible version in a more pythonic way for ziploader than we were doing in module replacer

* Make it possible to set the module compression as an inventory var

This may be necessary on systems where python has been compiled without
zlib compression.

* Refactoring of module_common code:

* module replacer only replaces values that make sense for that type of
  file (example: don't attempt to replace python imports if we're in
  a powershell module).
* Implement configurable shebang support for ziploader wrapper
* Implement client-side constants (for SELINUX_SPECIAL_FS and SYSLOG)
  via environment variable.
* Remove strip_comments param as we're never going to use it (ruins line
  numbering)

* Don't repeat ourselves about detecting REPLACER

* Add an easy way to debug

* Port test-module to the ziploader-aware modify_module()

* strip comments and blank lines from the wrapper so we send less over the wire.

* Comments cleanup

* Remember to output write the module line itself in powershell modules

* for line in lines strips the newlines so we have to add them back in
8 years ago
Toshio Kuratomi d3583108ec Fix log_invocation test on python2 with hash randomization 8 years ago
Matt Martz ad30bad14f Skip test_module_utils_basic__log_invocation until we can figure out the cause of the failure 8 years ago
James Cammarata 8eadc1d8eb Adding more unit tests for AnsibleModule things in basic.py 8 years ago