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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ilogue/fexpect/internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ def wrapExpectations(cmd):
script = createScript(cmd)
remoteScript = '/tmp/fexpect_'+shortuuid.uuid()
import pexpect
pexpect_module = pexpect.__file__
if pexpect_module.endswith('.pyc'):
pexpect_module = pexpect_module[:-1]
pexpect_loader= pexpect.__file__
final_dir_index = pexpect_loader.find('pexpect') + len('pexpect')
pexpect_loader= pexpect_loader[:final_dir_index]
# If mode not set explicitly, and this is run as a privileged user,
# later command from an unpriviliged user will fail due to the permissions
# on /tmp/pexpect.py
fabric.api.put(pexpect_module,'/tmp/', mode=0777)
fabric.api.put(pexpect_loader,'/tmp/', mode=0777)
fabric.api.put(StringIO(script),remoteScript)
wrappedCmd = 'python '+remoteScript
return wrappedCmd
Expand Down