From 692d97b85ab56b32e39e54ae7b47ed10762c9d91 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Tue, 12 Mar 2013 11:24:35 -0400 Subject: [PATCH] Use v2.0 api by default in auth_token middleware Fixes an issue that crept in with d782a99 where auth_token started defaulting to the v3.0 API by default when no version was specified. Given that bin/keystone still defaults to using the v2.0 API it seems like auth_token.py should too. Fixes LP Bug #1154144 Change-Id: Ia5620bccc182bbc73cb60dcccb1f701304450e5a --- keystoneclient/middleware/auth_token.py | 2 +- tests/test_auth_token_middleware.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/keystoneclient/middleware/auth_token.py b/keystoneclient/middleware/auth_token.py index 084d6f2ce..0a28194b7 100644 --- a/keystoneclient/middleware/auth_token.py +++ b/keystoneclient/middleware/auth_token.py @@ -211,7 +211,7 @@ opts = [ ] CONF.register_opts(opts, group='keystone_authtoken') -LIST_OF_VERSIONS_TO_ATTEMPT = ['v3.0', 'v2.0'] +LIST_OF_VERSIONS_TO_ATTEMPT = ['v2.0', 'v3.0'] def will_expire_soon(expiry): diff --git a/tests/test_auth_token_middleware.py b/tests/test_auth_token_middleware.py index cc730a7cf..935edad74 100644 --- a/tests/test_auth_token_middleware.py +++ b/tests/test_auth_token_middleware.py @@ -1323,6 +1323,7 @@ class v3AuthTokenMiddlewareTest(AuthTokenMiddlewareTest): 'revoked_token_hash': REVOKED_v3_TOKEN_HASH } super(v3AuthTokenMiddlewareTest, self).setUp( + auth_version='v3.0', fake_app=v3FakeApp, fake_http=v3FakeHTTPConnection, token_dict=token_dict, @@ -1355,7 +1356,7 @@ class v3AuthTokenMiddlewareTest(AuthTokenMiddlewareTest): v3FakeHTTPConnection.last_requested_url) def test_domain_scoped_uuid_request(self): - # Modify items comapred to default token for a domain scope + # Modify items compared to default token for a domain scope delta_expected_env = { 'HTTP_X_DOMAIN_ID': 'domain_id1', 'HTTP_X_DOMAIN_NAME': 'domain_name1',