Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.