How to continue a task when Fabric receives an error

后端 未结 7 1475
迷失自我
迷失自我 2020-12-04 23:16

When I define a task to run on several remote servers, if the task runs on server one and exits with an error, Fabric will stop and abort the task. But I want to make fabric

相关标签:
7条回答
  • 2020-12-04 23:48

    In Fabric 2.x you can just use invoke's run with the warn=True argument. Anyway, invoke is a dependency of Fabric 2.x:

    from invoke import run
    run('bad command', warn=True)
    

    From within a task:

    from invoke import task
    
    @task
    def my_task(c):
        c.run('bad command', warn=True)
    
    0 讨论(0)
提交回复
热议问题