Advertisement
Guest User

Untitled

a guest
Aug 18th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. diff --git a/novaclient/api_versions.py b/novaclient/api_versions.py
  2. index 63bc789..0005b96 100644
  3. --- a/novaclient/api_versions.py
  4. +++ b/novaclient/api_versions.py
  5. @@ -425,16 +425,17 @@ def _warn_missing_microversion_header(header_name):
  6.  
  7.  
  8. def deprecated_in(version):
  9. + decorator = wraps('2.0', version)
  10. def wrapper(fn):
  11. - @wraps('2.0', version)
  12. @functools.wraps(fn)
  13. def wrapped(*a, **k):
  14. + decorated = decorator(fn)
  15. if hasattr(fn, '__class__'):
  16. mod = fn.__class__.__module__
  17. else:
  18. mod = fn.__module__
  19. warnings.warn('The %s module is deprecated '
  20. 'and will be removed.' % mod, DeprecationWarning)
  21. - return fn(*a, **k)
  22. + return decorated(*a, **k)
  23. return wrapped
  24. return wrapper
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement