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

extra '\r' in command output #5

Open jererc opened 12 years ago

jererc commented 12 years ago

Hello

is it possible to correct the output, which has extra '\r' at the end of lines than with the fabric commands ?

Jérôme

JasperVanDenBosch commented 12 years ago

Yes, I'll gladly look into this. Do you happen to have some example output and the corresponding script?

jererc commented 12 years ago

hey

http://pastebin.com/KCASAkHj

JasperVanDenBosch commented 12 years ago

Thank you! I think I can fix this tonight.

jererc commented 12 years ago

Actually, is it possible to get the same exact output than when running the command like fabric run/sudo/local methods (without the pexpect 'before' attr content and "Exiting fexpect for EOF.") and also the pexpect 'exit_status' attribute if needed ?

JasperVanDenBosch commented 12 years ago

Okay, I need a bit more time, perhaps tomorrow. Some of these things are pexpect internal, but we can workaround by changing the output as you did. I will create some verbosity settings and in the end it should be possible for it to create the same output as regular run/sudo/local.

jererc commented 12 years ago

Hello I finally did my own lightweight expect using paramiko Channel, for speed purpose. I'll check your work out. Thanks

jererc commented 12 years ago

http://pastebin.com/WRRWf6jv

Feedbacks are welcome =)

jererc commented 12 years ago

Just created a repo there if you're interested or if you have suggestions: https://github.com/jererc/sshex-py

Jerome

JasperVanDenBosch commented 12 years ago

I will definitely have a look. Which of the features you mentioned before would you still like to see in fexpect? Or will you switch to sshex-py entirely? Just so I know where to put my priorities :)

jererc commented 12 years ago

Well, i'm using my own project. Although, i'm still interested in a fabric contrib with expect.

Thank you for the reactivity! =)