Description
As seen in this email on the paramiko ML, it looks like Paramiko offers an invoke_shell function which returns a Channel object, to which you can send data -- and apparently it acts like an interactive session.
However, send only returns the number of bytes successfully sent, not a return value; and the various methods for getting return values, such as recv_exit_status, appear to only work in tandem with exec_command (which is what we currently use.)
Worth investigating anyway, I can see this being a potentially useful option for folks who need serious shell-level persistence and are willing to forego the ability to get exit status during part of a session. Or, if we're lucky, I'm wrong and there is a reliable way to get "per-command" stdin/stdout/exit status -- though I rather doubt it.
TODO
- Exit shell at session close
- Hide and don't capture prompts
- Possibly hide remote command (though it might be nice not to, could save us the trouble of printing it ourselves. wrapped/real versions of command should still apply though -- maybe.)
- Reliably obtain return value, probably via
echo $? or similar
- Hide login banners, other non command info. (Possibly by having Fabric keep track of whether it's currently executing anything and to hide the remote stderr/stdout if not?)
Originally submitted by Jeff Forcier (bitprophet) on 2009-11-06 at 10:10am EST
Relations
Closed as Wontfix on 2010-06-03 at 11:26pm EDT
Description
As seen in this email on the paramiko ML, it looks like Paramiko offers an
invoke_shellfunction which returns aChannelobject, to which you cansenddata -- and apparently it acts like an interactive session.However,
sendonly returns the number of bytes successfully sent, not a return value; and the various methods for getting return values, such asrecv_exit_status, appear to only work in tandem withexec_command(which is what we currently use.)Worth investigating anyway, I can see this being a potentially useful option for folks who need serious shell-level persistence and are willing to forego the ability to get exit status during part of a session. Or, if we're lucky, I'm wrong and there is a reliable way to get "per-command" stdin/stdout/exit status -- though I rather doubt it.
TODO
echo $?or similarOriginally submitted by Jeff Forcier (bitprophet) on 2009-11-06 at 10:10am EST
Relations
Closed as Wontfix on 2010-06-03 at 11:26pm EDT