etcd3: use discard() rather than remove()

Change-Id: Icdf2ecc7e3500ef6c2efdc1f61d2431b13831141
This commit is contained in:
Julien Danjou 2017-05-22 14:26:55 +02:00
parent ae1e42274b
commit 24101cf264
1 changed files with 1 additions and 4 deletions

View File

@ -116,10 +116,7 @@ class Etcd3Lock(locking.Lock):
# FIXME(jd) when pyetcd3 returns the status
# https://github.com/kragniz/python-etcd3/pull/126
self._coord.client.delete(self._key)
try:
self._coord._acquired_locks.remove(self)
except KeyError:
pass
self._coord._acquired_locks.discard(self)
return True
@_translate_failures