Remove nodeid argument from updateNode

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

Change-Id: Ic9fcc74a873760f45b23e9af7345d9bf998a41f1
This commit is contained in:
James E. Blair 2018-11-29 16:31:12 -08:00 committed by Tobias Henkel
parent 0b00c4685b
commit 5b5a161b71
1 changed files with 3 additions and 4 deletions

View File

@ -233,7 +233,7 @@ class ZooKeeper(object):
request_nodes = list(node_request.nodeset.getNodes())
for i, nodeid in enumerate(data.get('nodes', [])):
request_nodes[i].id = nodeid
self.updateNode(request_nodes[i], nodeid)
self.updateNode(request_nodes[i])
node_request.updateFromDict(data)
def storeNode(self, node):
@ -248,14 +248,13 @@ class ZooKeeper(object):
path = '%s/%s' % (self.NODE_ROOT, node.id)
self.client.set(path, self._dictToStr(node.toDict()))
def updateNode(self, node, nodeid):
def updateNode(self, node):
'''Refresh an existing node.
:param Node node: The node to update.
:param Node nodeid: The zookeeper node ID.
'''
node_path = '%s/%s' % (self.NODE_ROOT, nodeid)
node_path = '%s/%s' % (self.NODE_ROOT, node.id)
node_data, node_stat = self.client.get(node_path)
node_data = self._strToDict(node_data)
node.updateFromDict(node_data)