diff options
author | Robey Pointer <robey@lag.net> | 2007-12-30 16:34:41 -0800 |
---|---|---|
committer | Robey Pointer <robey@lag.net> | 2007-12-30 16:34:41 -0800 |
commit | 06d3471b463ffe798d42e7d24e294bbc616d8358 (patch) | |
tree | f5b91b99d6262c02b4f40513b3749613b94172e7 | |
parent | d70878831c67c3b2d76ab304edadfaed3cfbb980 (diff) |
[project @ robey@lag.net-20071231003441-njdbcgbrqskrgtiw]
merge patch to allow bufsize param in SSHClient.exec_command()
-rw-r--r-- | paramiko/client.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/paramiko/client.py b/paramiko/client.py index c809e4bb..127ab131 100644 --- a/paramiko/client.py +++ b/paramiko/client.py @@ -299,7 +299,7 @@ class SSHClient (object): self._transport.close() self._transport = None - def exec_command(self, command): + def exec_command(self, command, bufsize=-1): """ Execute a command on the SSH server. A new L{Channel} is opened and the requested command is executed. The command's input and output @@ -308,6 +308,8 @@ class SSHClient (object): @param command: the command to execute @type command: str + @param bufsize: interpreted the same way as by the built-in C{file()} function in python + @type bufsize: int @return: the stdin, stdout, and stderr of the executing command @rtype: tuple(L{ChannelFile}, L{ChannelFile}, L{ChannelFile}) @@ -315,9 +317,9 @@ class SSHClient (object): """ chan = self._transport.open_session() chan.exec_command(command) - stdin = chan.makefile('wb') - stdout = chan.makefile('rb') - stderr = chan.makefile_stderr('rb') + stdin = chan.makefile('wb', bufsize) + stdout = chan.makefile('rb', bufsize) + stderr = chan.makefile_stderr('rb', bufsize) return stdin, stdout, stderr def invoke_shell(self, term='vt100', width=80, height=24): |