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

Fexpect breaks fabric #17

Open
keshavagrawal89 opened this issue Dec 2, 2013 · 1 comment
Open

Fexpect breaks fabric #17

keshavagrawal89 opened this issue Dec 2, 2013 · 1 comment
Assignees

Comments

@keshavagrawal89
Copy link

I don't know if its happening only with me or anybody else is also facing the same issue.

The moment I import this package

from ilogue.fexpect import expect, expecting, run

in my fabfile the script stops running with the following error:

Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/fabric/main.py", line 743, in main *args, **kwargs File "/usr/local/lib/python2.7/dist-packages/fabric/tasks.py", line 368, in execute multiprocessing File "/usr/local/lib/python2.7/dist-packages/fabric/tasks.py", line 264, in _execute return task.run(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/fabric/tasks.py", line 171, in run return self.wrapped(*args, **kwargs) File "/etc/puppet/fabfile.py", line 165, in edit_sudoers run('echo "Current Permission of the file /etc/sudoers - "stat -c "%a %n" /etc/sudoers') File "/usr/local/lib/python2.7/dist-packages/ilogue/fexpect/api.py", line 15, in run wrappedCmd = wrapExpectations(cmd) File "/usr/local/lib/python2.7/dist-packages/ilogue/fexpect/internals.py", line 15, in wrapExpectations script = createScript(cmd) File "/usr/local/lib/python2.7/dist-packages/ilogue/fexpect/internals.py", line 39, in createScript for e in fabric.state.env.expectations: File "/usr/local/lib/python2.7/dist-packages/fabric/utils.py", line 184, in getattr raise AttributeError(key) AttributeError: expectations

Versions used: fexpect==0.2.post7 Fabric==1.8.0

@JasperVanDenBosch
Copy link
Owner

That import statement overrides the regular fabric keywords such as run(). If you have not previously specified any expectations, the fexpect-wrapped run() cannot find them. You could change the import statement to something like:

from ilogue.fexpect import erun

This way the two versions do not get confused

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

No branches or pull requests

2 participants