Commit Graph

10 Commits

Author SHA1 Message Date
David Wilson 470d8399a3 ansible: document planner.Planner. 2018-04-01 22:31:45 +01:00
David Wilson 822502125d issue #106: 2.3.x compatible get_shebang-alike. 2018-04-01 22:04:05 +01:00
David Wilson a98a51a328 issue #106: handle JSONARGS modules too. 2018-04-01 21:20:58 +01:00
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.
2018-04-01 21:10:04 +01:00
David Wilson a954d54644 issue #106: support old-style too. 2018-04-01 19:01:18 +01:00
David Wilson 16b64392e2 issue #106: support WANT_JSON modules. 2018-04-01 18:19:34 +01:00
David Wilson 0dd5e04eae issue #106: partially working BinaryRunner/Planner.
Refactor planner.py to look a lot more like runner.py. This 'structural
cutpaste' looks messy -- probably we can simplify this code, even though
it's pretty simple already.
2018-04-01 16:39:10 +01:00
David Wilson 43e4f5009a issue #106: remove 2 needless Invocation attributes. 2018-04-01 16:39:10 +01:00
David Wilson c891ab078a issue #106: working old-style native module execution
Still abusing Python import mechanism, but one big step closer to
eliminating that.
2018-04-01 16:39:10 +01:00
David Wilson 3dc90b7618 issue #106: import skeletal planner module. 2018-03-30 16:06:23 +05:45