Search code examples
pythonlinuxfabric

Fabric Remote Execution requiring a user response from a prompt?


I would like to handle when a fabric script requires a response.

Eg. Apply the above migration? (yes|no) [no]:

The fab function that creates this prompt:

local("php root/protected/yiic.php migrate")


Solution

  • Try to disable interactive mode during running command:

    local("php root/protected/yiic.php migrate --interactive=0")
    

    From docs:

    interactive: boolean, specifies whether to perform migrations in an interactive mode. Defaults to true, meaning the user will be prompted when performing a specific migration.