ansible/test/units
Toshio Kuratomi d834412ead Fix for persistent connection plugin on Python3 (#24431)
Fix for persistent connection plugin on Python3.  Note that fixes are also needed to each terminal plugin.  This PR only fixes the ios terminal (as proof that this approach is workable.)  Future PRs can address the other terminal types.

* On Python3, pickle needs to work with byte strings, not text strings.
* Set the pickle protocol version to 0 because we're using a pty to feed data to the connection plugin.  A pty can't have control characters.  So we have to send ascii only.  That means
only using protocol=0 for pickling the data.
* ansible-connection isn't being used with py3 in the bug but it needs
several changes to work with python3.
* In python3, closing the pty too early causes no data to be sent.  So
leave stdin open until after we finish with the ansible-connection
process.
* Fix typo using traceback.format_exc()
* Cleanup unnecessary StringIO, BytesIO, and to_bytes calls
* Modify the network_cli and terminal plugins for py3 compat.  Lots of mixing of text and byte strings that needs to be straightened out to be compatible with python3
* Documentation for the bytes<=>text strategy for terminal plugins
* Update unittests for more bytes-oriented internals

Fixes #24355
2017-05-12 09:13:51 -07:00
..
cli Update module_utils.six to latest (#22855) 2017-03-23 13:35:05 -07:00
contrib Remove shebangs from unit tests. 2017-02-27 17:53:10 -08:00
errors Legacy pep8 updates for setup.py and tests 2017-02-11 16:04:52 -08:00
executor Remove hack for backwards compatible v2_playbook_on_start callback 2017-04-28 13:44:43 -07:00
inventory Update module_utils.six to latest (#22855) 2017-03-23 13:35:05 -07:00
inventory_test_data/group_vars
mock Update module_utils.six to latest (#22855) 2017-03-23 13:35:05 -07:00
module_utils [GCE] [GCP] UrlMap module (#24422) 2017-05-11 13:02:32 -04:00
modules [GCE] [GCP] UrlMap module (#24422) 2017-05-11 13:02:32 -04:00
parsing Fix vault reading from stdin (avoid realpath() on non-links) (#23583) 2017-04-18 13:09:02 -04:00
playbook deal with null/none connections 2017-05-11 15:46:14 -04:00
plugins Fix for persistent connection plugin on Python3 (#24431) 2017-05-12 09:13:51 -07:00
template Fix circular import with unsafe_proxy, template, and vars 2017-04-28 15:35:30 -07:00
utils PEP 8 indent cleanup. (#20800) 2017-01-29 07:28:53 +00:00
vars Update module_utils.six to latest (#22855) 2017-03-23 13:35:05 -07:00
__init__.py Add empty-init code-smell script. (#18406) 2016-11-07 15:02:13 -08:00
conftest.py Fix bugs in ansible-test units command. (#24044) 2017-04-27 11:21:11 +08:00
test_constants.py Update module_utils.six to latest (#22855) 2017-03-23 13:35:05 -07:00