ssh_alt.py / decrease # of ssh roundtrips

This commit is contained in:
jeromew 2013-12-09 13:59:41 -05:00
commit 7f8863f96d
22 changed files with 160 additions and 49 deletions

View file

@ -42,6 +42,7 @@ class Connection(object):
def __init__(self, runner, host, port, *args, **kwargs):
self.runner = runner
self.host = host
self.has_pipelining = False
# port is unused, this go on func
self.port = port
@ -53,9 +54,12 @@ class Connection(object):
return self
def exec_command(self, cmd, tmp_path, sudo_user, sudoable=False,
executable='/bin/sh'):
executable='/bin/sh', in_data=None):
''' run a command on the remote minion '''
if in_data:
raise errors.AnsibleError("Internal Error: this module does not support optimized module pipelining")
vvv("EXEC %s" % (cmd), host=self.host)
p = self.client.command.run(cmd)[self.host]
return (p[0], '', p[1], p[2])