Created
February 21, 2014 11:14
-
-
Save mrchilds/9132599 to your computer and use it in GitHub Desktop.
Custom fabric decorators
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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