Python Fabric: How to handle arbitrary remote shell prompt for input? Python Fabric: How to handle arbitrary remote shell prompt for input? django django

Python Fabric: How to handle arbitrary remote shell prompt for input?


I have proposed an API for this feature in fabric on the mailinglist,and ended up writing something myself:

from fexpect import expect, expecting, run prompts = []prompts += expect('What is your name?','John')prompts += expect('Where do you live?','New York')with expecting(prompts):    run('command')

See my blogpost on expecting prompts in fabric with fexpect


Interaction with remote servers is finally supported in Fabric 1.0. See this page for details.