From 82ee69b56c6b5e166ade43cca536d2ad4af5aaec Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 6 Nov 2018 08:18:37 -0500 Subject: [PATCH] Age out macmap on node database changes This mitigates problems where automation fails to quickly react to changes/fixes in the net attributes. --- confluent_server/confluent/discovery/core.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/confluent_server/confluent/discovery/core.py b/confluent_server/confluent/discovery/core.py index cbf625cf..63ea0014 100644 --- a/confluent_server/confluent/discovery/core.py +++ b/confluent_server/confluent/discovery/core.py @@ -463,6 +463,9 @@ def _recheck_nodes_backend(nodeattribs, configmanager): _map_unique_ids(nodeattribs) # for the nodes whose attributes have changed, consider them as potential # strangers + if nodeattribs: + macmap.vintage = 0 # expire current mac map data, in case + # the attributes changed impacted the result for node in nodeattribs: if node in known_nodes: for somemac in known_nodes[node]: @@ -1100,6 +1103,7 @@ needaddhandled = False def _handle_nodelist_change(configmanager): global needaddhandled global nodeaddhandler + macmap.vintage = 0 # the current mac map is probably inaccurate _recheck_nodes((), configmanager) if needaddhandled: needaddhandled = False