Skip to content

Instantly share code, notes, and snippets.

@JensRantil
Last active December 27, 2015 22:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Generic Fabric executation example.
"""Common functions and data structures exposed to other modules in package."""
from fabric.api import *
def run_or_local(*args, **kwargs):
"""Execute a command locally if env.host=='localhost'."""
if env.host_string=='localhost':
return local(capture=True, *args, **kwargs)
else:
return run(*args, **kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment