summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2016-03-16 14:54:58 +0100
committerJulien Danjou <julien@danjou.info>2016-05-30 15:26:59 +0200
commit274f9a61c1af032736a9749437effe4e59f0a68d (patch)
tree931fa770fd41fbf653c61d2f70a552e8565754a3
parent0f4e1198fdcbd6a29d77c67d105d201ed0fbd9e0 (diff)
downloadtooz-274f9a61c1af032736a9749437effe4e59f0a68d.tar.gz
redis: do not force LuaLock
LuaLock are used automatically if available by the Redis client, so let's enjoy that. If they are not available, it'll use standard locks anyhow. Change-Id: Iac82622bbbf05c9472fe2c62723d46ea18ba7e6b
-rw-r--r--tooz/drivers/redis.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/tooz/drivers/redis.py b/tooz/drivers/redis.py
index e4a6e43..466fe1f 100644
--- a/tooz/drivers/redis.py
+++ b/tooz/drivers/redis.py
@@ -26,7 +26,6 @@ from oslo_utils import encodeutils
from oslo_utils import strutils
import redis
from redis import exceptions
-from redis import lock as redis_locks
from redis import sentinel
import six
from six.moves import map as compat_map
@@ -59,9 +58,9 @@ class RedisLock(locking.Lock):
def __init__(self, coord, client, name, timeout):
name = "%s_%s_lock" % (coord.namespace, six.text_type(name))
super(RedisLock, self).__init__(name)
- self._lock = redis_locks.LuaLock(client, name,
- timeout=timeout,
- thread_local=False)
+ self._lock = client.lock(name,
+ timeout=timeout,
+ thread_local=False)
self._coord = coord
self._client = client