Skip to content

Instantly share code, notes, and snippets.

@goosemo
Created October 24, 2011 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goosemo/1309985 to your computer and use it in GitHub Desktop.
Save goosemo/1309985 to your computer and use it in GitHub Desktop.
fabfile I used for testing
from fabric.api import *
@parallel
@hosts("hosta", "hostb")
def test1():
local("exit 0")
if env.host == "hostb":
local("exit 1")
@parallel
@hosts("hosta", "hostb")
def test2():
local("echo 'should not run'")
╭─mgoose@mgoose-ml ~/workspace/fabric ‹457-failure-checking-for-parallel*›
╰─$ ~/Envs/fabric-testing/bin/fab -f fabtest.py test1 test2 (env: fabric-testing)
[hosta] Executing task 'test1'
[hostb] Executing task 'test1'
[localhost] local: exit 0
[localhost] local: exit 0
[localhost] local: exit 1
Fatal error: local() encountered an error (return code 1) while executing 'exit 1'
Aborting.
Fatal error: A task has failed on at least one host. Aborting.
Aborting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment