Sugested Additional Feature : channel.execute_in_interactive_shell('cmd')
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
paramiko |
New
|
Undecided
|
Unassigned |
Bug Description
It is necessary on occasion to execute a command in interactive shell. (I needed to to get access to some env vars... ) While there are many way to accomplish this I opted to run my cmd in interactive mode.
To do so I had to write this little wrapper snippet and figured it might make a good additional method for paramiko.channel.
<code>
def .execute_
"""
Execute a command on the server inside an interactive shell.
If the server allows it, the channel will then be directly connected to
the stdin, stdout, and stderr of the command being executed.
To accomplish this we initiate a shell without getting a tty first.
"""
if self.closed or self.eof_received or self.eof_sent or not self.active:
raise SSHException(
m = Message()
m.add_
m.add_
m.add_
m.add_
m.add_
self.
#### Mod starts here
self.
self.
#### Thant it....
self.
self.
</code>
Thank you - paramiko really saved my life (well project).
Adam Grandt
<email address hidden>