JasperVanDenBosch / fexpect

extension for fabric to handle prompts through pexpect
http://ilogue.com/jasper/blog/fexpect--dealing-with-prompts-in-fabric-with-pexpect/
BSD 2-Clause "Simplified" License
44 stars 13 forks source link

Fixed issue with fexpect sending __init__.py to remote system (instead of entire pexpect directory) #19

Open jladdjr opened 10 years ago

jladdjr commented 10 years ago

Method wrapExpectations() in internals.py is responsible for uploading the pexpect library to the remote system. The current code assumes that pexpect is a single file (pexpect.py) when instead pexpect is a package containing several files (see https://github.com/pexpect/pexpect/tree/master/pexpect). When it tries to locate pexpect, it selects pexpect/init.py instead of the entire folder. When fexpect tries to run the remote script, the script fails to import pexpect and dies.

This commit modifies the code so that it correctly pushes the entire pexpect directory to the remote system.

JasperVanDenBosch commented 10 years ago

Hi Jim, appreciate your contribution! Could you give a few more details on when this happens for you? it seems that for most people 'pexpect.py' is picked correctly, and I would prefer just sending one file instead of a whole directory.

jladdjr commented 10 years ago

Hi back,

I am currently swamped at work and don't have room to go back and get more details on this right now. I know that's not very helpful, but I wanted to at least check in. If I have the chance to look back at this, I'll post an update on this ticket - thanks!!

Jim