diff --git a/etcd3gw/lock.py b/etcd3gw/lock.py index 3de9ae7..1567102 100644 --- a/etcd3gw/lock.py +++ b/etcd3gw/lock.py @@ -30,7 +30,7 @@ def __init__(self, name, ttl=DEFAULT_TIMEOUT, client=None): self.client = client self.key = LOCK_PREFIX + self.name self.lease = None - self._uuid = None + self._uuid = str(uuid.uuid1()) @property def uuid(self): @@ -40,7 +40,6 @@ def uuid(self): def acquire(self): """Acquire the lock.""" self.lease = self.client.lease(self.ttl) - self._uuid = str(uuid.uuid1()) base64_key = _encode(self.key) base64_value = _encode(self._uuid)