summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Urdin <tobias.urdin@binero.com>2022-09-28 12:31:40 +0200
committerSahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>2023-02-08 10:53:26 +0000
commitf8d80022f3922a6765df3f9a7f44982aca031c22 (patch)
treedc7dcc6781ed01c429aae73d156b2dc390d6b041
parentbe6aa856a5385d7a9dbf04683ed6a263f12de48e (diff)
downloadosprofiler-f8d80022f3922a6765df3f9a7f44982aca031c22.tar.gz
Change StrictRedis usage to Redis
The StrictRedis class is only an alias for Redis in >= 3.0.0 Change-Id: I5b72306ec2d3164b285c24190c0d3f9ced4b6a31
-rw-r--r--osprofiler/drivers/redis_driver.py4
-rw-r--r--releasenotes/notes/remove-strict-redis-9eb43d30c9c1fc43.yaml4
2 files changed, 6 insertions, 2 deletions
diff --git a/osprofiler/drivers/redis_driver.py b/osprofiler/drivers/redis_driver.py
index ba7a121..db861f6 100644
--- a/osprofiler/drivers/redis_driver.py
+++ b/osprofiler/drivers/redis_driver.py
@@ -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:"
diff --git a/releasenotes/notes/remove-strict-redis-9eb43d30c9c1fc43.yaml b/releasenotes/notes/remove-strict-redis-9eb43d30c9c1fc43.yaml
new file mode 100644
index 0000000..c11467c
--- /dev/null
+++ b/releasenotes/notes/remove-strict-redis-9eb43d30c9c1fc43.yaml
@@ -0,0 +1,4 @@
+---
+upgrade:
+ - |
+ The minimum redis-py version required is now >= 3.0.0