summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@redhat.com>2018-11-29 16:31:12 -0800
committerTobias Henkel <tobias.henkel@bmw.de>2018-11-30 12:11:47 +0000
commit5b5a161b71fe9a7e8862e8058838cb42385fec6f (patch)
tree44035f6908fb4296ea93117c50d57ea5abbdde00
parent0b00c4685b1883dcb6d9ac1814acc68c89eeae26 (diff)
Remove nodeid argument from updateNode
This function expects a node object with the .id attribute populated. Change-Id: Ic9fcc74a873760f45b23e9af7345d9bf998a41f1
Notes
Notes (review): Code-Review+2: Clark Boylan <cboylan@sapwetik.org> Code-Review+2: Tobias Henkel <tobias.henkel@bmw.de> Workflow+1: Tobias Henkel <tobias.henkel@bmw.de> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Sat, 01 Dec 2018 20:10:17 +0000 Reviewed-on: https://review.openstack.org/621047 Project: openstack-infra/zuul Branch: refs/heads/master
-rw-r--r--zuul/zk.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/zuul/zk.py b/zuul/zk.py
index f1ff4c8..1544c23 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)