Change StrictRedis usage to Redis

The StrictRedis class is only an alias for
Redis in >= 3.0.0

Change-Id: I5b72306ec2d3164b285c24190c0d3f9ced4b6a31
This commit is contained in:
Tobias Urdin 2022-09-28 12:31:40 +02:00 committed by Sahid Orentino Ferdjaoui
parent be6aa856a5
commit f8d80022f3
2 changed files with 6 additions and 2 deletions

View File

@ -37,7 +37,7 @@ class Redis(base.Driver):
service=service, host=host,
conf=conf, **kwargs)
try:
from redis import StrictRedis
from redis import Redis as _Redis
except ImportError:
raise exc.CommandError(
"To use OSProfiler with Redis driver, "
@ -46,7 +46,7 @@ class Redis(base.Driver):
# only connection over network is supported with schema
# redis://[:password]@host[:port][/db]
self.db = StrictRedis.from_url(self.connection_str)
self.db = _Redis.from_url(self.connection_str)
self.namespace_opt = "osprofiler_opt:"
self.namespace = "osprofiler:" # legacy
self.namespace_error = "osprofiler_error:"

View File

@ -0,0 +1,4 @@
---
upgrade:
- |
The minimum redis-py version required is now >= 3.0.0