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

executing local command, but it prompts "No hosts found. Please specify (single) host string for connection" #12

Closed tly1980 closed 10 years ago

tly1980 commented 11 years ago

Here is my code,

from ilogue.fexpect import expect, expecting, local

@task
def test_expect():
    prompts = []
    prompts += expect('enter aes-256-cbc decryption password', 'abc')

    with expecting(prompts):
        local('echo "ENCRYPTED TEXT...." | openssl enc -d -aes-256-cbc -a')

however it gives me following error

No hosts found. Please specify (single) host string for connection:

This is supposed to be a local command. Why it is asking me the host config ?

tly1980 commented 11 years ago

Fabric & fexpect version: Fabric==1.7.0 fexpect==0.2.post7

jladdjr commented 11 years ago

Hi tly1980,

Thanks for touching base with the issue you mentioned. Let me dig into this and see if I can find a fix for you - thanks!

Jim

On Wed, Jul 31, 2013 at 5:08 AM, tly1980 notifications@github.com wrote:

Fabric & fexpect version: Fabric==1.7.0 fexpect==0.2.post7

— Reply to this email directly or view it on GitHubhttps://github.com/ilogue/fexpect/issues/12#issuecomment-21849292 .

beaugunderson commented 11 years ago

Also hitting this fabric==1.8.0 and fexpect==0.2.post7.

gblaha commented 10 years ago

Me too. Would love for local() to not require a hostname. Looks like the problem might be that local() calls wrapExpectations(), which calls fabric.api.put(). For a "local" fabric task, a simple local file operation -- rather than a fabric.api.put() call -- should do.

JasperVanDenBosch commented 10 years ago

I agree, but don't have the time to look into this now.. sorry.

quietlyconfident commented 10 years ago

The pull request I submitted (#18) fixes this issue.

JasperVanDenBosch commented 10 years ago

Thanks Erik! Looks good. Do most of you just clone from here or is there a lot of interest to update the pypi package?

quietlyconfident commented 10 years ago

Hi-

Thank you! I can’t speak for anyone else, but I would use the pypi package if it were updated; it makes it simpler to automate installations.

-Erik

On Dec 29, 2013, at 7:54 PM, ilogue notifications@github.com wrote:

Thanks Erik! Looks good. Do most of you just clone from here or is there a lot of interest to update the pypi package?

— Reply to this email directly or view it on GitHub.

JasperVanDenBosch commented 10 years ago

Alright, fexpect-0.2.post17 is now on pypi.