community.general/lib/ansible/utils
Ganesh Nalawade 90cd87f950
Fix debug logs failing with persistent connection (#33049)
* Fix debug logs failing with persistent connection

Fixes #33047

*  As debug logs are written on stdout, it interrupts
   the communication between ansible-connection(background)
   process and main process. To avoid this add a string similar
   to exactly identify the response string.

*  Remove unwanted code in ansible-connection

*  Fix review comments

* Fix spurious log emitted on ansible-connection stdout issue

*  ansible-connection which runs as a background process sends a
   json string (contains response received from remote device)
   to foreground ansible-playbook process over stdout.

*  If in case debug flag is enabled the connection_loader api
   invoked from ansible-connection `ssh = connection_loader.get('ssh', class_only=True)`
   results in emitting debug logs on stdout. This  spurious log
   interfere with the actual response and results in failure while
   reading json string in ansible-playbook process

* To avoid this save stdout of ansible-connection and redirect it string
  buffer to accumulate all the logs emitted by core API's

* Add these logs in `result['messages']` which is send a json string after reinstating saved stdout

*  Remove unwanted code in ansible-connection

* Fix review comment
2018-01-25 02:48:45 +05:30
..
module_docs_fragments adds two new infoblox lookup plugins (#35189) 2018-01-24 13:28:21 +00:00
__init__.py limit extensions for files in group/host_vars dir 2015-05-23 20:34:08 +02:00
cmd_functions.py ansible/utils/: PEP8 compliancy (#24686) 2017-05-30 18:09:44 +01:00
color.py Fix several things causing tracebacks with unicode cwd (#27731) 2017-08-04 09:25:08 -04:00
display.py Fix debug logs failing with persistent connection (#33049) 2018-01-25 02:48:45 +05:30
encrypt.py Remove uses of assert in production code (#32079) 2017-11-13 11:51:18 -05:00
hashing.py Move uses of to_bytes, to_text, to_native to use the module_utils version (#17423) 2016-09-06 22:54:17 -07:00
helpers.py skip all hidden keys, allow exclude list 2017-08-28 12:56:14 -04:00
jsonrpc.py Refactor junos modules to Use netconf and cliconf plugins (#32621) 2017-11-24 12:04:47 +05:30
listify.py ansible/utils/: PEP8 compliancy (#24686) 2017-05-30 18:09:44 +01:00
path.py fix paths to actually be config file relative (#31533) 2017-10-10 19:17:17 -07:00
plugin_docs.py Temporary (#31677) 2018-01-15 21:15:04 -08:00
shlex.py Update module_utils.six to latest (#22855) 2017-03-23 13:35:05 -07:00
ssh_functions.py Fix encoding error with path to ssh 2017-09-22 15:31:21 -07:00
unicode.py Remove deprecated code (#34828) 2018-01-23 12:02:09 -06:00
unsafe_proxy.py Fix undefined variables, basestring usage, and some associated python3 issues 2017-07-25 15:58:23 -07:00
vars.py expose soem options as vars (#30379) 2017-09-17 12:25:56 -04:00