ssh_alt.py / decrease # of ssh roundtrips

This commit is contained in:
jeromew 2013-12-11 04:55:56 -05:00
parent dc41912158
commit 5c965a75f0
23 changed files with 175 additions and 57 deletions

View file

@ -45,6 +45,7 @@ class Connection(object):
self.password = password
self.private_key_file = private_key_file
self.HASHED_KEY_MAGIC = "|1|"
self.has_pipelining = False
fcntl.lockf(self.runner.process_lockfile, fcntl.LOCK_EX)
self.cp_dir = utils.prepare_writeable_dir('$HOME/.ansible/cp',mode=0700)
@ -144,9 +145,12 @@ class Connection(object):
return False
return True
def exec_command(self, cmd, tmp_path, sudo_user,sudoable=False, executable='/bin/sh'):
def exec_command(self, cmd, tmp_path, sudo_user,sudoable=False, executable='/bin/sh', in_data=None):
''' run a command on the remote host '''
if in_data:
raise errors.AnsibleError("Internal Error: this module does not support optimized module pipelining")
ssh_cmd = self._password_cmd()
ssh_cmd += ["ssh", "-tt"]
if utils.VERBOSITY > 3: