summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrant Knudson <bknudson@us.ibm.com>2013-07-29 17:42:38 -0500
committerBrant Knudson <bknudson@us.ibm.com>2013-07-29 17:43:27 -0500
commita2f0a012ded013f48f5c8efce52e66478c9e313d (patch)
treebe365a70037b5b5a9d0e5bdae3c49f59cb64a8b8
parent10fde8e5a61a1f0f0a1388b80a504c5a4290a96f (diff)
downloadkeystone-a2f0a012ded013f48f5c8efce52e66478c9e313d.tar.gz
keystone-a2f0a012ded013f48f5c8efce52e66478c9e313d.tar.xz
keystone-a2f0a012ded013f48f5c8efce52e66478c9e313d.zip
Use keystone.wsgi.Request for RequestClass
Keystone defines a custom Request class that's used in many places (middleware, etc.). BaseApplication says that subclasses should typically set Request as the custom RequestClass, but for some reason it's not used in keystone.wsgi.Application. This doesn't cause any problems at this point because Keystone's custom Request is the same as webob.Request. bp user-locale-api requires the custom Request to implement calculating the requested locale, and if Application doesn't set this custom RequestClass then most requests don't using the custom Request. Part of changes for bp user-locale-api Change-Id: If20ee9000aba89a5a2c94ed8a3dda7382142038e
-rw-r--r--keystone/common/wsgi.py2
-rw-r--r--tests/test_wsgi.py4
2 files changed, 2 insertions, 4 deletions
diff --git a/keystone/common/wsgi.py b/keystone/common/wsgi.py
index 381f1ff0..87636dbe 100644
--- a/keystone/common/wsgi.py
+++ b/keystone/common/wsgi.py
@@ -203,7 +203,7 @@ class BaseApplication(object):
class Application(BaseApplication):
- @webob.dec.wsgify
+ @webob.dec.wsgify(RequestClass=Request)
def __call__(self, req):
arg_dict = req.environ['wsgiorg.routing_args'][1]
action = arg_dict.pop('action')
diff --git a/tests/test_wsgi.py b/tests/test_wsgi.py
index 369dd952..003f7571 100644
--- a/tests/test_wsgi.py
+++ b/tests/test_wsgi.py
@@ -14,8 +14,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-import webob
-
from keystone import test
from keystone.common import wsgi
@@ -34,7 +32,7 @@ class BaseWSGITest(test.TestCase):
super(BaseWSGITest, self).setUp()
def _make_request(self, url='/'):
- req = webob.Request.blank(url)
+ req = wsgi.Request.blank(url)
args = {'action': 'index', 'controller': None}
req.environ['wsgiorg.routing_args'] = [None, args]
return req