ansible/lib/ansible
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
..
cli Fix option descriptions in ansible-doc output 2015-09-22 10:00:33 +03:00
compat Making the switch to v2 2015-05-03 21:47:26 -05:00
config Making the switch to v2 2015-05-03 21:47:26 -05:00
errors Making the switch to v2 2015-05-03 21:47:26 -05:00
executor Close module file once we're done reading from it 2015-09-21 01:46:29 -07:00
galaxy Fix typo in ansible module_utils import from galaxy code 2015-09-17 14:25:48 -04:00
inventory Use dict.get() 2015-09-20 22:54:02 -03:00
module_utils fixed case in which boto3 is present but module is not using it yet 2015-09-21 15:16:07 -04:00
modules Update submodule refs. 2015-09-22 14:01:53 -07:00
new_inventory Making the switch to v2 2015-05-03 21:47:26 -05:00
parsing Python 3: there's no basestring 2015-09-22 08:42:33 +03:00
playbook Restrict role param vars to tasks within that role 2015-09-22 02:14:18 -04:00
plugins Reorganise ssh.py to cleanly separate responsibilities 2015-09-23 01:55:00 -04:00
template Fix safe_eval() of set literals 2015-09-11 09:41:05 +03:00
utils Remove custom json encoder cleaner and strip proxy var stuff out before encoding 2015-09-17 16:04:47 -04:00
vars Fix handling of conditional vars_files which contain variables 2015-09-23 01:26:24 -04:00
__init__.py Re-adding submodules after moving things around 2015-05-03 22:30:51 -05:00
constants.py fixed typo 2015-09-21 10:10:21 -04:00
test-requirements.txt Making the switch to v2 2015-05-03 21:47:26 -05:00