Hi,

I am using Fabric 1.9 and am trying to control an interactive prompt from a
bash script.  According to the Fabric documentation and GitHub tickets #741
& #1021, there is support to send interactive responses with the prompts
dictionary object.  The documentation at
http://docs.fabfile.org/en/latest/usage/env.html#prompts is unclear about
describing how to use prompts in conjunction with the run() method.  I am
trying to send an interactive response to a remote command.

I tried defining the prompts dictionary and using it in the following way:

def runcommand():
     # I understand that the dict keys are the stdout text to expect and
the corresponding dict values are the text to send on stdin to satisfy the
waiting bash script's prompt
     prompts = {"Are you sure you want to continue (yes/no)?": "yes"}
     run(bash_script)

tests/test_io.py has the only code example that sort of explains the
prompts dictionary usage, but overriding the run method as described there
does not achieve the desired behavior.  Shouldn't interactive prompts work
without having to override run()?  I have only a beginner regarding Fabric,
but I would greatly appreciate any guidance in this matter.

Thank you,
Justin
_______________________________________________
Fab-user mailing list
Fab-user@nongnu.org
https://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to