python - 我可以使用 Fabric 执行交互式 shell 命令吗?

标签 python shell interactive fabric

我正在尝试使用 fabric安装和部署一个 web 项目,在此期间我需要创建一个 postgresql 数据库并配置一个 RabbitMQ 服务器。这两个操作都是交互式的,需要用户输入以创建数据库、添加用户、设置密码等(至少据我所知)。

我可以使用结构脚本来执行这些交互式 shell 操作吗?

最佳答案

这是在 Fabric 1.0 中。我试过了,它对我有用。

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

编辑:正如 payne 在下面指出的那样,Fabric 1.0 已发布。我编辑了答案以表明这一点。

关于python - 我可以使用 Fabric 执行交互式 shell 命令吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5182857/

相关文章:

bash - 在分隔符之前删除一个单词 - Bash

Linux bash,获取 getopt 默认参数

yaml - kubectl YAML 配置文件等效于 "kubectl run ... -i --tty ..."

python - 如何从 Pandas DataFrame 中提取值,而不是 Series(不引用索引)?

python - 当参数可能非常大时进行内存

python - 在网址中添加破折号

linux - 在 shell 脚本中的捕获组中转义引号

ruby SSH : interactive command "su": How further after successfull logged in?

python - cython setup.py 给出 .o 而不是 .dll