Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate pexpect/expect integration #177

Closed
bitprophet opened this issue Aug 19, 2011 · 4 comments
Closed

Investigate pexpect/expect integration #177

bitprophet opened this issue Aug 19, 2011 · 4 comments

Comments

@bitprophet
Copy link
Member

Description

Spinoff of a note from #7 which, for now, is too "big" to be included in that effort.

From a quick look at the pexpect library, it's not suitable for use with Fabric since it handles the IO itself -- i.e. it wraps subprocess or similar to call local programs.

However, there is a fdpexpect which, while experimental, allows one to pass in file descriptors instead. I haven't taken the time to see how exactly this might, or might not, work with the file-like objects Paramiko gives us, so take a look and see if it's at all feasible.

Finally: if that's a no-go, consider rolling our own solution either based on a pexpect-like API, or just whatever feels most Pythonic/useful to us. Start by simply abstracting out the stuff that ended up in the new IO loop that handles sudo password memory.


Originally submitted by Jeff Forcier (bitprophet) on 2010-06-12 at 07:47pm EDT

Relations

@ghost ghost assigned bitprophet Aug 19, 2011
@bitprophet
Copy link
Member Author

Jeff Forcier (bitprophet) posted:


Looks like pexpect's API is really just "block and wait for XXX pattern to show up", and the rest of the module is simply ancillary stuff for controlling the subprocess or FD under inspection. Given that, I think it'll be simpler/faster to simply expand on what we already use in-house for the password memory.


on 2010-08-01 at 10:31am EDT

@bitprophet
Copy link
Member Author

Morgan Goose (goosemo) posted:


Is this cruft now that you've got the interactive going in 1.x?


on 2011-04-08 at 06:55am EDT

@bitprophet
Copy link
Member Author

Jeff Forcier (bitprophet) posted:


This request serves two use cases:

  1. Full noninteractivity in any situation no matter what, e.g. "my commands result in a prompt which cannot be automated remotely, so I want Fabric to be capable of expect-like behavior."
  2. Working around the inability to address prompts by hand.

Interactivity now removes the pressure for 2) above, but 1) remains a valid, if lofty, goal.

So I think this should remain open, but at a low priority and a far-ahead milestone.


on 2011-04-19 at 02:55pm EDT

@JasperVanDenBosch
Copy link

In the meantime, I rolled a rough implementation of pexpect 'integration' in fabric in a separate module called fexpect , based on the interface I suggested on the mailinglist. This might be a nice work-around for now.

Here is the gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants