summaryrefslogtreecommitdiffstats
path: root/ssh.py
diff options
context:
space:
mode:
authorAvery Pennarun <apenwarr@gmail.com>2010-11-09 00:17:01 -0800
committerAvery Pennarun <apenwarr@gmail.com>2010-11-09 00:17:01 -0800
commit32b4defa9b55ba8a214373a408ef6b42c9a58414 (patch)
treea8f7cb6fa034c43f783a94665606c79a946e8fab /ssh.py
parent8b7605cc5de585dc34296cc7ca42d8602f52c68a (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.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/ssh.py b/ssh.py
index a222bf3..df3a537 100644
--- a/ssh.py
+++ b/ssh.py
@@ -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