Can I use Fabric to perform interactive shell commands?

China☆狼群 提交于 2019-12-05 15:59:49

问题


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:


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.



来源:https://stackoverflow.com/questions/5182857/can-i-use-fabric-to-perform-interactive-shell-commands

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!