Browse Source

Remove nodeid argument from updateNode

This function expects a node object with the .id attribute populated.

Change-Id: Ic9fcc74a873760f45b23e9af7345d9bf998a41f1
tags/3.4.0
James E. Blair 5 months ago
parent
commit
5b5a161b71
1 changed files with 3 additions and 4 deletions
  1. 3
    4
      zuul/zk.py

+ 3
- 4
zuul/zk.py View File

@@ -233,7 +233,7 @@ class ZooKeeper(object):
233 233
         request_nodes = list(node_request.nodeset.getNodes())
234 234
         for i, nodeid in enumerate(data.get('nodes', [])):
235 235
             request_nodes[i].id = nodeid
236
-            self.updateNode(request_nodes[i], nodeid)
236
+            self.updateNode(request_nodes[i])
237 237
         node_request.updateFromDict(data)
238 238
 
239 239
     def storeNode(self, node):
@@ -248,14 +248,13 @@ class ZooKeeper(object):
248 248
         path = '%s/%s' % (self.NODE_ROOT, node.id)
249 249
         self.client.set(path, self._dictToStr(node.toDict()))
250 250
 
251
-    def updateNode(self, node, nodeid):
251
+    def updateNode(self, node):
252 252
         '''Refresh an existing node.
253 253
 
254 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 258
         node_data, node_stat = self.client.get(node_path)
260 259
         node_data = self._strToDict(node_data)
261 260
         node.updateFromDict(node_data)

Loading…
Cancel
Save