Can I use Fabric to perform interactive shell comm

2019-04-05 00:11发布

I`m trying to use fabric to install and deploy a web project during which I need to create a postgresql database and configure a RabbitMQ server. Both these operations are interactive and requires input from the user for creating a database, adding a user, setting password etc ( at least to my knowledge ).

Can I use a fabric script to do interative shell operations like these?

1条回答
可以哭但决不认输i
2楼-- · 2019-04-05 00:15

This is in Fabric 1.0. I've tried it and it works for me.

Older versions of Fabric (and similar high level SSH libraries) run remote programs in limbo, unable to be touched from the local end. This is problematic when you have a serious need to enter passwords or otherwise interact with the remote program.

Fabric 1.0 and later breaks down this wall and ensures you can always talk to the other side.

Source

Edit: As payne notes below, Fabric 1.0 was released. I edited the answer to indicate this.

查看更多
登录 后发表回答