mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-26 11:30:23 +00:00
Update node collection handlers for renamed
Rename support will provide a map of old to new name. Have the existing node collection watchers accept a new argument.
This commit is contained in:
parent
1b355ec468
commit
23c9e6315a
@ -290,7 +290,7 @@ def logException():
|
||||
|
||||
def _do_add_watcher(watcher, added, configmanager):
|
||||
try:
|
||||
watcher(added=added, deleting=[], configmanager=configmanager)
|
||||
watcher(added=added, deleting=(), renamed=(), configmanager=configmanager)
|
||||
except Exception:
|
||||
logException()
|
||||
|
||||
@ -1705,7 +1705,7 @@ class ConfigManager(object):
|
||||
def _true_del_nodes(self, nodes):
|
||||
if self.tenant in self._nodecollwatchers:
|
||||
for watcher in self._nodecollwatchers[self.tenant].itervalues():
|
||||
watcher(added=[], deleting=nodes, configmanager=self)
|
||||
watcher(added=(), deleting=nodes, renamed=(), configmanager=self)
|
||||
changeset = {}
|
||||
for node in nodes:
|
||||
# set a reserved attribute for the sake of the change notification
|
||||
|
@ -621,7 +621,7 @@ def disconnect_node(node, configmanager):
|
||||
del _handled_consoles[consk]
|
||||
|
||||
|
||||
def _nodechange(added, deleting, configmanager):
|
||||
def _nodechange(added, deleting, renamed, configmanager, renamed=()):
|
||||
for node in added:
|
||||
connect_node(node, configmanager)
|
||||
for node in deleting:
|
||||
|
@ -1129,7 +1129,7 @@ def _handle_nodelist_change(configmanager):
|
||||
nodeaddhandler = None
|
||||
|
||||
|
||||
def newnodes(added, deleting, configmanager):
|
||||
def newnodes(added, deleting, renamed, configmanager):
|
||||
global attribwatcher
|
||||
global needaddhandled
|
||||
global nodeaddhandler
|
||||
|
Loading…
Reference in New Issue
Block a user