community.general/lib/ansible/plugins
Abhijit Menon-Sen 840a32bc08 Reorganise ssh.py to cleanly separate responsibilities
The main exec_command/put_file/fetch_file methods now _build_command and
call _run to handle input from/output to the ssh process. The purpose is
to bring connection handling together in one place so that the locking
doesn't have to be split across functions.

Note that this doesn't change the privilege escalation and connection IO
code at all—just puts it all into one function.

Most of the changes are just moving code from one place to another (e.g.
from _connect to _build_command, from _exec_command and _communicate to
_run), but there are some other notable changes:

1. We test for the existence of sshpass the first time we need to use
   password authentication, and remember the result.
2. We set _persistent in _build_command if we're using ControlPersist,
   for later use in close(). (The detection could be smarter.)
3. Some apparently inadvertent inconsistencies between put_file and
   fetch_file (e.g. argument quoting, sftp -b use) have been removed.

Also reorders functions into a logical sequence, removes unused imports
and functions, etc.

Aside: the high-level EXEC/PUT/FETCH description should really be logged
from ConnectionBase, while individual subclasses log transport-specific
details.
2015-09-23 01:55:00 -04:00
..
action Fixing synchronize + delegate_to user bug 2015-09-22 16:06:52 -04:00
cache Simplify FactCache.copy() 2015-09-03 09:44:44 +03:00
callback Additional tweaks to callback output for delegate_to 2015-09-22 09:25:38 -04:00
connection Reorganise ssh.py to cleanly separate responsibilities 2015-09-23 01:55:00 -04:00
filter Resurrection of the comment filter 2015-09-10 14:37:42 +02:00
inventory Remove unused (copied) _before_comment method 2015-08-21 06:58:23 +05:30
lookup Some LookupBase cleanups: 2015-09-22 16:19:36 -07:00
shell Add PowerShell exception handling and turn on strict mode. 2015-09-15 16:32:35 -04:00
strategy Don't bomb out on handlers with undefined variables in their names 2015-09-22 12:42:02 -04:00
test moved mandatory back to filters as it does not always return a boolean, it does an exception on failure 2015-08-21 09:54:56 -04:00
vars Making the switch to v2 2015-05-03 21:47:26 -05:00
__init__.py Fix for user defined modules not overriding modules from core. 2015-09-22 09:07:37 -07:00