diff options
author | Naveed Massjouni <naveedm9@gmail.com> | 2011-03-11 12:45:53 -0500 |
---|---|---|
committer | Naveed Massjouni <naveedm9@gmail.com> | 2011-03-11 12:45:53 -0500 |
commit | a5415e8fc40eaa82761532e5ba83c3800cf9ed78 (patch) | |
tree | 5128865a4acf58d774e78fed48df9001089834ba | |
parent | 76b5871adbb1bfc2e3d2a1151a00fa654c45953d (diff) | |
download | nova-a5415e8fc40eaa82761532e5ba83c3800cf9ed78.tar.gz nova-a5415e8fc40eaa82761532e5ba83c3800cf9ed78.tar.xz nova-a5415e8fc40eaa82761532e5ba83c3800cf9ed78.zip |
Need to set version to '1.0' in the nova.context in test code for tests to be
happy.
-rw-r--r-- | nova/api/openstack/auth.py | 3 | ||||
-rw-r--r-- | nova/tests/api/openstack/fakes.py | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/nova/api/openstack/auth.py b/nova/api/openstack/auth.py index 320443935..8461a8059 100644 --- a/nova/api/openstack/auth.py +++ b/nova/api/openstack/auth.py @@ -57,8 +57,9 @@ class AuthMiddleware(wsgi.Middleware): return faults.Fault(webob.exc.HTTPUnauthorized()) project = self.auth.get_project(FLAGS.default_project) + version = req.path.split('/')[1].replace('v', '') req.environ['nova.context'] = context.RequestContext(user, project, - version=req.script_name.replace('/v', '')) + version=version) return self.application def has_authentication(self, req): diff --git a/nova/tests/api/openstack/fakes.py b/nova/tests/api/openstack/fakes.py index 2c4e57246..8ec1629f4 100644 --- a/nova/tests/api/openstack/fakes.py +++ b/nova/tests/api/openstack/fakes.py @@ -68,7 +68,7 @@ def fake_auth_init(self, application): @webob.dec.wsgify def fake_wsgi(self, req): - req.environ['nova.context'] = context.RequestContext(1, 1) + req.environ['nova.context'] = context.RequestContext(1, 1, version='1.0') if req.body: req.environ['inst_dict'] = json.loads(req.body) return self.application |