mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 20:01:25 -07:00
ssh_alt.py / decrease # of ssh roundtrips
This commit is contained in:
parent
dc41912158
commit
5c965a75f0
23 changed files with 175 additions and 57 deletions
|
@ -121,6 +121,7 @@ class Connection(object):
|
|||
self.user = user
|
||||
self.password = password
|
||||
self.private_key_file = private_key_file
|
||||
self.has_pipelining = False
|
||||
|
||||
def _cache_key(self):
|
||||
return "%s__%s__" % (self.host, self.user)
|
||||
|
@ -175,9 +176,12 @@ class Connection(object):
|
|||
|
||||
return ssh
|
||||
|
||||
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")
|
||||
|
||||
bufsize = 4096
|
||||
try:
|
||||
chan = self.ssh.get_transport().open_session()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue