相关疑难解决方法(0)

如何在Fabric收到错误时继续执行任务

当我定义要在多个远程服务器上运行的任务时,如果任务在服务器1上运行并退出并出现错误,则Fabric将停止并中止该任务.但是我想让Fabric忽略错误并在下一个服务器上运行任务.我该怎么做呢?

例如:

$ fab site1_service_gw
[site1rpt1] Executing task 'site1_service_gw'

[site1fep1] run: echo 'Nm123!@#' | sudo -S route
[site1fep1] err:
[site1fep1] err: We trust you have received the usual lecture from the local System
[site1fep1] err: Administrator. It usually boils down to these three things:
[site1fep1] err:
[site1fep1] err:     #1) Respect the privacy of others.
[site1fep1] err:     #2) Think before you type.
[site1fep1] err:     #3) With great power comes great responsibility.
[site1fep1] err: root's password:
[site1fep1] err: sudo: route: command not …
Run Code Online (Sandbox Code Playgroud)

python fabric

93
推荐指数
6
解决办法
5万
查看次数

标签 统计

fabric ×1

python ×1