Merge "Remove the useless require_admin_context decorator"
This commit is contained in:
commit
fb43dbcb9e
@ -199,20 +199,6 @@ def get_backend():
|
||||
return sys.modules[__name__]
|
||||
|
||||
|
||||
def require_admin_context(f):
|
||||
"""Decorator to require admin request context.
|
||||
|
||||
The first argument to the wrapped function must be the context.
|
||||
|
||||
"""
|
||||
|
||||
@functools.wraps(f)
|
||||
def wrapper(*args, **kwargs):
|
||||
nova.context.require_admin_context(args[0])
|
||||
return f(*args, **kwargs)
|
||||
return wrapper
|
||||
|
||||
|
||||
def require_context(f):
|
||||
"""Decorator to require *any* user or admin context.
|
||||
|
||||
|
@ -176,9 +176,6 @@ class DecoratorTestCase(test.TestCase):
|
||||
def test_require_context_decorator_wraps_functions_properly(self):
|
||||
self._test_decorator_wraps_helper(sqlalchemy_api.require_context)
|
||||
|
||||
def test_require_admin_context_decorator_wraps_functions_properly(self):
|
||||
self._test_decorator_wraps_helper(sqlalchemy_api.require_admin_context)
|
||||
|
||||
def test_require_deadlock_retry_wraps_functions_properly(self):
|
||||
self._test_decorator_wraps_helper(
|
||||
oslo_db_api.wrap_db_retry(max_retries=5, retry_on_deadlock=True))
|
||||
|
Loading…
x
Reference in New Issue
Block a user