summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-12-01 20:10:17 +0000
committerGerrit Code Review <review@openstack.org>2018-12-01 20:10:18 +0000
commit9f849e1f9935c366f99181ee115a06bdc8cac505 (patch)
tree82ed331b66a3430ffffdf633479ab3dcb9190cd7
parent271feec3ca9182e746fb0562ef22fff1e9c86c81 (diff)
parent5b5a161b71fe9a7e8862e8058838cb42385fec6f (diff)
Merge "Remove nodeid argument from updateNode"
-rw-r--r--zuul/zk.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/zuul/zk.py b/zuul/zk.py
index 6586641..bd476c0 100644
--- a/zuul/zk.py
+++ b/zuul/zk.py
@@ -233,7 +233,7 @@ class ZooKeeper(object):
233 request_nodes = list(node_request.nodeset.getNodes()) 233 request_nodes = list(node_request.nodeset.getNodes())
234 for i, nodeid in enumerate(data.get('nodes', [])): 234 for i, nodeid in enumerate(data.get('nodes', [])):
235 request_nodes[i].id = nodeid 235 request_nodes[i].id = nodeid
236 self.updateNode(request_nodes[i], nodeid) 236 self.updateNode(request_nodes[i])
237 node_request.updateFromDict(data) 237 node_request.updateFromDict(data)
238 238
239 def storeNode(self, node): 239 def storeNode(self, node):
@@ -248,14 +248,13 @@ class ZooKeeper(object):
248 path = '%s/%s' % (self.NODE_ROOT, node.id) 248 path = '%s/%s' % (self.NODE_ROOT, node.id)
249 self.client.set(path, self._dictToStr(node.toDict())) 249 self.client.set(path, self._dictToStr(node.toDict()))
250 250
251 def updateNode(self, node, nodeid): 251 def updateNode(self, node):
252 '''Refresh an existing node. 252 '''Refresh an existing node.
253 253
254 :param Node node: The node to update. 254 :param Node node: The node to update.
255 :param Node nodeid: The zookeeper node ID.
256 ''' 255 '''
257 256
258 node_path = '%s/%s' % (self.NODE_ROOT, nodeid) 257 node_path = '%s/%s' % (self.NODE_ROOT, node.id)
259 node_data, node_stat = self.client.get(node_path) 258 node_data, node_stat = self.client.get(node_path)
260 node_data = self._strToDict(node_data) 259 node_data = self._strToDict(node_data)
261 node.updateFromDict(node_data) 260 node.updateFromDict(node_data)