Skip to content

Instantly share code, notes, and snippets.

@ers81239
Created January 26, 2012 21:43
Show Gist options
  • Save ers81239/1685287 to your computer and use it in GitHub Desktop.
Save ers81239/1685287 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
#fabric parallel test file
from fabric.api import *
@parallel
def parFunc():
print env.host
@serial
def serFunc():
print env.host
execute(parFunc,hosts=["root@grizzly"])
execute(serFunc,hosts=["root@grizzly"])
"""
Output
[root@grizzly] Executing task 'parFunc'
root@grizzly
[root@grizzly] Executing task 'serFunc'
grizzly
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment