Commit Graph

22 Commits (586318c475670d4c1794e39f1d4b44b5e889b0ed)

Author SHA1 Message Date
David Wilson a5e4a6f346 issue #106: move helpers.get_bytecode() into NewStyleRunner 6 years ago
David Wilson 8cc20856a8 issue #106: support custom new-style modules + 'reexec by default'
Rather than assume any structure about the Python code:

* Delete the exit_json/fail_json monkeypatches.
* Patch SystemExit rather than a magic monkeypatch-thrown exception
* Setup fake cStringIO stdin, stdout, stderr and return those along with
  SystemExit exit status
* Setup _ANSIBLE_ARGS as we used to, since we still want to override
  that with '{}' to prevent accidental import hangs, but also provide
  the same string via sys.stdin.
* Compile the module bytecode once and re-execute it for every
  invocation. May change this back again later, once some benchmarks are
  done.
* Remove the fixups stuff for now, it's handled by ^ above.

Should support any "somewhat new style" Python module, including those
that just give up and dump stuff to stdout directly.
6 years ago
David Wilson df6daaf3c4 issue #106: working/semantically compatible binary support. 6 years ago
David Wilson 8fffb34752 issue #106: helpers.get_file(), command logging.
* Add helpers.get_file() that calls back up into FileService as
  necessary. This is a stopgap measure.

* Add logging to exec_args() to simplify debugging of binary runners.
6 years ago
David Wilson c891ab078a issue #106: working old-style native module execution
Still abusing Python import mechanism, but one big step closer to
eliminating that.
6 years ago
David Wilson 98c15942f7 issue #177: fix bizarre syntax error in last commit. 6 years ago
David Wilson cf25437019 issue #177: populate Shell.tempdir global on creating a tempdir.
It looks a lot like multiple calls to _make_tmp_path() will result in
multiple temporary directories on the remote machine, only the last of
which will be cleaned up.

We must be bug-for-bug compatible for now, so ignore the problem in the
meantime.
6 years ago
David Wilson cd1683b924 ansible: split environment editing into a separate class. 6 years ago
David Wilson 749eddac71 ansible: fix flake8 errors in helpers.py. 6 years ago
David Wilson 3e384db7c2 service: add basic security policy types. 6 years ago
David Wilson 89b0faae2f Workaround for global state in yum_repository module; closes #154. 6 years ago
David Wilson 9b7991cd45 issue #118: log exceptions for emulated commands, fix AttributeError in helpers.py
Turns out Ansible can't be trusted to actually check the result
dictionary everywhere it expects one, so put the real exception text
into -vvv output too.
6 years ago
David Wilson 7080751f13 ansible: support environment: too. 6 years ago
David Wilson 3183dd4147 ansible: initial support for async jobs
Running in a thread to begin with, but this must change.
6 years ago
David Wilson f6d87faf37 tests: import ansible_helpers_test. 6 years ago
David Wilson 207159cf1a ansible: fix bug in apply_mode_spec(). 6 years ago
David Wilson ff617824a1 ansible: fix some flake8 errors
* Unused imports
* Undefined names in helpers.py
* Copyright header wrapping
6 years ago
David Wilson 83f2862431 ansible: _remote_chmod() / _fixup_perms2() can be called sometimes.
It's used at least by the copy module, even though the result is still
mostly a no-op. _remote_chmod() doesn't accept octal mode, it accepts
symbolic mode. So implement a symbolic parser in helpers.py.
6 years ago
David Wilson f3315fc172 ansible: better emulate _low_level_execute_command()
Still needs a ton of work to emulate argument handling, shell selection,
and output emulation in every case. Unsurprisingly, Ansible documents
none of this.
6 years ago
David Wilson b7f563a6f0 ansible: remove old action subdirectory. 6 years ago
David Wilson 331f77ee2b ansible: generalized action module wrapping. 6 years ago
David Wilson a35fcf44cc ansible: restructure to avoid intermediate imports 6 years ago