summaryrefslogtreecommitdiffstats
path: root/openstack/common/exception.py
diff options
context:
space:
mode:
authorAndrew Bogott <abogott@wikimedia.org>2012-07-02 16:28:05 -0500
committerAndrew Bogott <abogott@wikimedia.org>2012-07-03 17:38:37 -0500
commitd9e28ba02c30255511a56a59e93da283c172dffe (patch)
treeb509f07af5400eea1993b19bee0a492265f29674 /openstack/common/exception.py
parent506486550480fb222a92447e1e8baca855d126aa (diff)
downloadoslo-d9e28ba02c30255511a56a59e93da283c172dffe.tar.gz
oslo-d9e28ba02c30255511a56a59e93da283c172dffe.tar.xz
oslo-d9e28ba02c30255511a56a59e93da283c172dffe.zip
Move get_context_from_function_and_args() to context.py
Word on the street is that exception.py may soon be deprecated, and context.py is a better place anyway. (Also removed an import of utils.py because /it/ imports exception.py.) Change-Id: I856fc6f4558cc01ddca350ee4cfd4684db47475b
Diffstat (limited to 'openstack/common/exception.py')
-rw-r--r--openstack/common/exception.py17
1 files changed, 0 insertions, 17 deletions
diff --git a/openstack/common/exception.py b/openstack/common/exception.py
index e8ea110..e5da94b 100644
--- a/openstack/common/exception.py
+++ b/openstack/common/exception.py
@@ -146,20 +146,3 @@ class MalformedRequestBody(OpenstackException):
class InvalidContentType(OpenstackException):
message = "Invalid content type %(content_type)s"
-
-
-def get_context_from_function_and_args(function, args, kwargs):
- """Find an arg of type RequestContext and return it.
-
- This is useful in a couple of decorators where we don't
- know much about the function we're wrapping.
- """
-
- # import here to avoid circularity:
- from openstack.common import context
-
- for arg in itertools.chain(kwargs.values(), args):
- if isinstance(arg, context.RequestContext):
- return arg
-
- return None