ansible/ansible — pull request #836 by sfromm (2012-08-10 05:03:10+00:00)
Title: Fixes for raw module usage and failure to open_session()

Commit f9bdfde fixes runner in the case when using the raw module so that it doesn't try to create or remove tmp files on the minion.

Commit 569d377 wraps paramiko's open_session() call in exec_command() in a try/except to catch case where open_session() fails. This failed for me when using paramiko to connect to a non-unix host via ssh. Here's the traceback:

nodename | FAILED => Traceback (most recent call last):
File "/home/sfromm/Source/ansible/lib/ansible/runner/__init__.py", line 451, in _executor
exec_rc = self._executor_internal(host)
File "/home/sfromm/Source/ansible/lib/ansible/runner/__init__.py", line 497, in _executor_internal
return self._executor_internal_inner(host, inject, port)
File "/home/sfromm/Source/ansible/lib/ansible/runner/__init__.py", line 576, in _executor_internal_inner
result = handler(conn, tmp, inject=inject)
File "/home/sfromm/Source/ansible/lib/ansible/runner/__init__.py", line 240, in _execute_raw
stdout=self._low_level_exec_command(conn, self.module_args, tmp, sudoable = True)
File "/home/sfromm/Source/ansible/lib/ansible/runner/__init__.py", line 631, in _low_level_exec_command
stdin, stdout, stderr = conn.exec_command(cmd, tmp, sudo_user, sudoable=sudoable)
File "/home/sfromm/Source/ansible/lib/ansible/runner/connection/paramiko_ssh.py", line 84, in exec_command
chan = self.ssh.get_transport().open_session()
File "/usr/lib/python2.6/site-packages/paramiko/transport.py", line 648, in open_session
return self.open_channel('session')
File "/usr/lib/python2.6/site-packages/paramiko/transport.py", line 738, in open_channel
raise e
EOFError