Commit a7415e54 by Michael DeHaan

Merge pull request #836 from sfromm/rawfixes

Fixes for raw module usage and failure to open_session()
parents 535e3f13 569d3771
...@@ -568,6 +568,8 @@ class Runner(object): ...@@ -568,6 +568,8 @@ class Runner(object):
module_name = utils.template(self.module_name, inject) module_name = utils.template(self.module_name, inject)
tmp = ''
if self.module_name != 'raw':
tmp = self._make_tmp_path(conn) tmp = self._make_tmp_path(conn)
result = None result = None
...@@ -595,6 +597,7 @@ class Runner(object): ...@@ -595,6 +597,7 @@ class Runner(object):
del result.result['daisychain'] del result.result['daisychain']
if self.module_name != 'raw':
self._delete_remote_files(conn, tmp) self._delete_remote_files(conn, tmp)
conn.close() conn.close()
......
...@@ -84,7 +84,13 @@ class ParamikoConnection(object): ...@@ -84,7 +84,13 @@ class ParamikoConnection(object):
''' run a command on the remote host ''' ''' run a command on the remote host '''
bufsize = 4096 bufsize = 4096
try:
chan = self.ssh.get_transport().open_session() chan = self.ssh.get_transport().open_session()
except Exception, e:
msg = "Failed to open session"
if len(str(e)) > 0:
msg += ": %s" % str(e)
raise errors.AnsibleConnectionFailed(msg)
chan.get_pty() chan.get_pty()
if not self.runner.sudo or not sudoable: if not self.runner.sudo or not sudoable:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment