diff --git a/releasenotes/notes/remove-strict-redis-e50cccbdf4a86f76.yaml b/releasenotes/notes/remove-strict-redis-e50cccbdf4a86f76.yaml new file mode 100644 index 000000000..c11467cd7 --- /dev/null +++ b/releasenotes/notes/remove-strict-redis-e50cccbdf4a86f76.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + The minimum redis-py version required is now >= 3.0.0 diff --git a/zaqar/storage/redis/driver.py b/zaqar/storage/redis/driver.py index 18153aa3e..6ec9fb34e 100644 --- a/zaqar/storage/redis/driver.py +++ b/zaqar/storage/redis/driver.py @@ -318,14 +318,14 @@ def _get_redis_client(driver): return sentinel.master_for(connection_uri.master) elif connection_uri.strategy == STRATEGY_TCP: - return redis.StrictRedis( + return redis.Redis( host=connection_uri.hostname, port=connection_uri.port, db=connection_uri.dbid, password=connection_uri.password, socket_timeout=connection_uri.socket_timeout) else: - return redis.StrictRedis( + return redis.Redis( unix_socket_path=connection_uri.unix_socket_path, db=connection_uri.dbid, password=connection_uri.password, diff --git a/zaqar/tests/unit/storage/test_impl_redis.py b/zaqar/tests/unit/storage/test_impl_redis.py index 8424bc75d..feefa6dbe 100644 --- a/zaqar/tests/unit/storage/test_impl_redis.py +++ b/zaqar/tests/unit/storage/test_impl_redis.py @@ -179,13 +179,13 @@ class RedisDriverTest(testing.TestBase): driver.ControlDriver (self.conf, cache)) - self.assertIsInstance(redis_driver.connection, redis.StrictRedis) + self.assertIsInstance(redis_driver.connection, redis.Redis) def test_version_match(self): oslo_cache.register_config(self.conf) cache = oslo_cache.get_cache(self.conf) - with mock.patch('redis.StrictRedis.info') as info: + with mock.patch('redis.Redis.info') as info: info.return_value = {'redis_version': '2.4.6'} self.assertRaises(RuntimeError, driver.DataDriver, self.conf, cache,