From 5cd2fa9121307f55957699fc09cdc19d813c4e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionu=C8=9B=20Ar=C8=9B=C4=83ri=C8=99i?= Date: Thu, 14 Feb 2013 14:40:25 +0100 Subject: [PATCH] fix unit test when memcache middleware is not configured Fixes: keystoneclient.middleware.auth_token: INFO: Starting keystone auth_token middlewa re keystoneclient.middleware.auth_token: INFO: Using /opt/stack/keystone/examples/pk i/certs as cache directory for signing certificate keystoneclient.middleware.auth_token: DEBUG: Authenticating user token keystoneclient.middleware.auth_token: DEBUG: Removing headers from request enviro nment: X-Identity-Status,X-Tenant-Id,X-Tenant-Name,X-User-Id,X-User-Name,X-Roles, X-Service-Catalog,X-User,X-Tenant,X-Role keystoneclient.middleware.auth_token: DEBUG: Keystone did not return json-encoded body keystoneclient.middleware.auth_token: DEBUG: Marking token invalid-token as unaut horized in memcache keystoneclient.middleware.auth_token: DEBUG: Token validation failure. Traceback (most recent call last): File "/opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py" , line 574, in _validate_user_token data = self.verify_uuid_token(user_token, retry) File "/opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py" , line 824, in verify_uuid_token self._cache_store_invalid(user_token) File "/opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py" , line 794, in _cache_store_invalid self._cache_store(token, 'invalid') File "/opt/stack/python-keystoneclient/keystoneclient/middleware/auth_token.py" , line 771, in _cache_store timeout=self.token_cache_time) TypeError: set() got an unexpected keyword argument 'timeout' keystoneclient.middleware.auth_token: DEBUG: Marking token invalid-token as unaut horized in memcache This can be reproduced on devstack. Fixes bug 1102520 Change-Id: Ib9e110d60df40e30d74c3059bd25e459a95f9850 --- tests/test_auth_token_middleware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_auth_token_middleware.py b/tests/test_auth_token_middleware.py index 0c00e59ef1..0a85977d67 100644 --- a/tests/test_auth_token_middleware.py +++ b/tests/test_auth_token_middleware.py @@ -229,7 +229,7 @@ class FakeMemcache(object): data['access']['token']['expires'] = ks_expires return (data, str(self.token_expiration)) - def set(self, key, value, time=None): + def set(self, key, value, time=None, timeout=None): self.set_value = value self.set_key = key