Merge "Remove support for old Swift memcache interface."
This commit is contained in:
@@ -1064,19 +1064,9 @@ class AuthProtocol(object):
|
||||
cache_key = CACHE_KEY_TEMPLATE % memcache_crypt.get_cache_key(keys)
|
||||
data_to_store = memcache_crypt.protect_data(keys, serialized_data)
|
||||
|
||||
# Historically the swift cache connection used the argument
|
||||
# timeout= for the cache timeout, but this has been unified
|
||||
# with the official python memcache client with time= since
|
||||
# grizzly, we still need to handle folsom for a while until
|
||||
# this could get removed.
|
||||
try:
|
||||
self._cache.set(cache_key,
|
||||
data_to_store,
|
||||
time=self.token_cache_time)
|
||||
except(TypeError):
|
||||
self._cache.set(cache_key,
|
||||
data_to_store,
|
||||
timeout=self.token_cache_time)
|
||||
self._cache.set(cache_key,
|
||||
data_to_store,
|
||||
time=self.token_cache_time)
|
||||
|
||||
def _invalid_user_token(self, msg=False):
|
||||
# NOTE(jamielennox): use False as the default so that None is valid
|
||||
|
||||
@@ -178,13 +178,6 @@ class TimezoneFixture(fixtures.Fixture):
|
||||
time.tzset()
|
||||
|
||||
|
||||
class FakeSwiftOldMemcacheClient(memorycache.Client):
|
||||
# NOTE(vish,chmou): old swift memcache uses param timeout instead of time
|
||||
def set(self, key, value, timeout=0, min_compress_len=0):
|
||||
sup = super(FakeSwiftOldMemcacheClient, self)
|
||||
sup.set(key, value, timeout, min_compress_len)
|
||||
|
||||
|
||||
class FakeApp(object):
|
||||
"""This represents a WSGI app protected by the auth_token middleware."""
|
||||
|
||||
@@ -733,11 +726,6 @@ class CommonAuthTokenMiddlewareTest(object):
|
||||
mock_utcnow.return_value = expired
|
||||
self.assertIsNone(self._get_cached_token(token))
|
||||
|
||||
def test_old_swift_memcache_set_expired(self):
|
||||
extra_conf = {'cache': 'swift.cache'}
|
||||
extra_environ = {'swift.cache': FakeSwiftOldMemcacheClient()}
|
||||
self.test_memcache_set_expired(extra_conf, extra_environ)
|
||||
|
||||
def test_swift_memcache_set_expired(self):
|
||||
extra_conf = {'cache': 'swift.cache'}
|
||||
extra_environ = {'swift.cache': memorycache.Client()}
|
||||
|
||||
Reference in New Issue
Block a user