summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2013-02-03 12:53:35 -0800
committerJeff Forcier <jeff@bitprophet.org>2013-02-03 12:53:35 -0800
commit6b5d7483583627ae5cceee2a59c9c23b78ed0a0b (patch)
tree9181390f26a41225246303ef2592d05c15662346
parent0d38f3f1f266092a2a5e91cae9527acd8bbb72e7 (diff)
parentcd51bfc031eb9163fd6c85bb3d4ec23476bb2090 (diff)
Merge pull request #115 from mvanderkolff/master
Add get_pty named argument to SSHClient.exec_command()
-rw-r--r--paramiko/client.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/paramiko/client.py b/paramiko/client.py
index a777b45b..f8638068 100644
--- a/paramiko/client.py
+++ b/paramiko/client.py
@@ -349,7 +349,7 @@ class SSHClient (object):
self._agent.close()
self._agent = None
- def exec_command(self, command, bufsize=-1, timeout=None):
+ def exec_command(self, command, bufsize=-1, timeout=None, get_pty=False):
"""
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
@@ -368,6 +368,8 @@ class SSHClient (object):
@raise SSHException: if the server fails to execute the command
"""
chan = self._transport.open_session()
+ if(get_pty):
+ chan.get_pty()
chan.settimeout(timeout)
chan.exec_command(command)
stdin = chan.makefile('wb', bufsize)