Bump Redis client version to 4.1.1 88/7588/4
authorTimo Tietavainen <timo.tietavainen@nokia.com>
Thu, 20 Jan 2022 06:34:29 +0000 (08:34 +0200)
committerTimo Tietavainen <timo.tietavainen@nokia.com>
Thu, 20 Jan 2022 13:41:17 +0000 (15:41 +0200)
Bump Redis client version to the latest 4.1.1 version and replace
deprecated Redis client '_compat' module with 'utils' module.
SDLPY version: 3.0.2

Issue-Id: RIC-698

Signed-off-by: Timo Tietavainen <timo.tietavainen@nokia.com>
Change-Id: I1d15bc2ea1a11d4cf1e3fafac53ee584b373a7c4

docs/release-notes.rst
ricsdl-package/ricsdl/__init__.py
ricsdl-package/ricsdl/backend/redis.py
ricsdl-package/setup.py

index fc75037..4013a07 100644 (file)
@@ -33,6 +33,11 @@ This document provides the release notes of the ricsdl library.
 Version history
 ---------------
 
+[3.0.2] - 2022-01-20
+
+* Bump Redis client version to 4.1.1 and replace deprecated Redis client '_compat'
+  module with 'utils' module.
+
 [3.0.1] - 2021-11-18
 
 * Add specific package versions for required dependencies: redis==3.5.3 and
index 2ffa2d3..d8e421e 100644 (file)
@@ -31,7 +31,7 @@ from .exceptions import (
 )
 
 
-__version__ = '3.0.1'
+__version__ = '3.0.2'
 
 
 __all__ = [
index 1c549db..3ebc8cb 100755 (executable)
@@ -28,7 +28,7 @@ import redis
 from redis import Redis
 from redis.sentinel import Sentinel
 from redis.lock import Lock
-from redis._compat import nativestr
+from redis.utils import str_if_bytes
 from redis import exceptions as redis_exceptions
 from ricsdl.configuration import _Configuration
 from ricsdl.exceptions import (
@@ -69,7 +69,7 @@ class PubSub(redis.client.PubSub):
 
         Adapted from: https://github.com/andymccurdy/redis-py/blob/master/redis/client.py
         """
-        message_type = nativestr(response[0])
+        message_type = str_if_bytes(response[0])
         if message_type == 'pmessage':
             message = {
                 'type': message_type,
@@ -392,7 +392,7 @@ class RedisBackend(DbBackendAbc):
             new_sentinel = Sentinel([sentinel_node])
             new_redis = new_sentinel.master_for(master_name)
 
-        new_redis.set_response_callback('SETIE', lambda r: r and nativestr(r) == 'OK' or False)
+        new_redis.set_response_callback('SETIE', lambda r: r and str_if_bytes(r) == 'OK' or False)
         new_redis.set_response_callback('DELIE', lambda r: r and int(r) == 1 or False)
 
         redis_pubsub = PubSub(self.event_separator, new_redis.connection_pool, ignore_subscribe_messages=True)
index 85eebd9..0f5c60d 100644 (file)
@@ -58,7 +58,7 @@ setup(
     keywords="RIC SDL",
     install_requires=[
         'setuptools',
-        'redis==3.5.3',
+        'redis==4.1.1',
         'hiredis==2.0.0'
     ],
     long_description=_long_descr(),