Skip to content

Instantly share code, notes, and snippets.

@mrchilds
Created February 21, 2014 11:14
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 mrchilds/9132599 to your computer and use it in GitHub Desktop.
Save mrchilds/9132599 to your computer and use it in GitHub Desktop.
Custom fabric decorators
# To use a custom decoractor with fabric
# the decorator needs @wraps(func) otherwise
from functools import wraps
def lock_hubot_aws_changes_when_running(func):
@wraps(func)
def wrapper(*args, **kwargs):
print 'do something'
result = func(*args, **kwargs)
print 'do something'
return result
return wrapper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment