Merge pull request #836 from sfromm/rawfixes
Fixes for raw module usage and failure to open_session()
This commit is contained in:
commit
a7415e5409
2 changed files with 12 additions and 3 deletions
|
@ -568,6 +568,8 @@ class Runner(object):
|
|||
|
||||
module_name = utils.template(self.module_name, inject)
|
||||
|
||||
tmp = ''
|
||||
if self.module_name != 'raw':
|
||||
tmp = self._make_tmp_path(conn)
|
||||
result = None
|
||||
|
||||
|
@ -595,6 +597,7 @@ class Runner(object):
|
|||
|
||||
del result.result['daisychain']
|
||||
|
||||
if self.module_name != 'raw':
|
||||
self._delete_remote_files(conn, tmp)
|
||||
conn.close()
|
||||
|
||||
|
|
|
@ -84,7 +84,13 @@ class ParamikoConnection(object):
|
|||
''' run a command on the remote host '''
|
||||
|
||||
bufsize = 4096
|
||||
try:
|
||||
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()
|
||||
|
||||
if not self.runner.sudo or not sudoable:
|
||||
|
|
Loading…
Add table
Reference in a new issue