Fix removal of keys on failed initialization.

The initialize key was checked against the value
of the node name before removal, but it was changed
recently to contain either an empty string, or cluster
sysid. To fix this, the check for the previous value
was simply removed: we can guarantee that the code path
that removes the key is the one that created it.
This commit is contained in:
Oleksii Kliukin
2015-10-23 10:46:55 +02:00
parent 5ae6f3a56c
commit 0c5a21e57d
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -249,7 +249,7 @@ class Etcd(AbstractDCS):
@catch_etcd_errors
def cancel_initialization(self):
return self.retry(self.client.delete, self.initialize_path, prevValue=self._name)
return self.retry(self.client.delete, self.initialize_path)
def watch(self, timeout):
cluster = self.cluster
+1 -1
View File
@@ -271,7 +271,7 @@ class ZooKeeper(AbstractDCS):
def _cancel_initialization(self):
node = self.get_node(self.initialize_path)
if node and node[0] == self._name:
if node:
self.client.delete(self.initialize_path, version=node[1].version)
def cancel_initialization(self):