2012-06-22 53 views

回答

0

您可以随时使用新的execute()并将其封装在try/except中,或者只查看run()的返回码。

5

把下面的内容你fabfile:

from fabric.context_managers import settings 

def task_name(): 
    # commands that are not expected to fail 
    ... 
    with settings(warn_only=True): 
     # commands that might fail 
     ... 
    clean_up() 

你甚至可能想给整个任务的warn_only=True治疗,如果你不在乎:

@with_settings(warn_only=True) 
def task_name(): 
    ... 

more info

+0

这必须贯穿方法。作为一个普遍的尝试抓住 –

相关问题