diff options
author | Avery Pennarun <apenwarr@gmail.com> | 2010-11-09 00:17:01 -0800 |
---|---|---|
committer | Avery Pennarun <apenwarr@gmail.com> | 2010-11-09 00:17:01 -0800 |
commit | 32b4defa9b55ba8a214373a408ef6b42c9a58414 (patch) | |
tree | a8f7cb6fa034c43f783a94665606c79a946e8fab /ssh.py | |
parent | 8b7605cc5de585dc34296cc7ca42d8602f52c68a (diff) |
Add a new --ssh-cmd= option to let you override the ssh command.
Requested by Axel Beckert.
Diffstat (limited to 'ssh.py')
-rw-r--r-- | ssh.py | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -21,7 +21,7 @@ def empackage(z, filename): return '%s\n%d\n%s' % (basename,len(content), content) -def connect(rhostport, python): +def connect(ssh_cmd, rhostport, python): main_exe = sys.argv[0] l = (rhostport or '').split(':', 1) rhost = l[0] @@ -53,7 +53,13 @@ def connect(rhostport, python): if not rhost: argv = [python, '-c', pyscript] else: - argv = ['ssh'] + portl + [rhost, '--', "'%s' -c '%s'" % (python, pyscript)] + if ssh_cmd: + sshl = ssh_cmd.split(' ') + else: + sshl = ['ssh'] + argv = (sshl + + portl + + [rhost, '--', "'%s' -c '%s'" % (python, pyscript)]) (s1,s2) = socket.socketpair() def setup(): # runs in the child process |