remove endpoints that are no longer in mac table
@@ -187,14 +187,20 @@ class Update_Switch_State(Monitor_Helper_Base):
# print the state of things the first time
self.endpoints.print_endpoint_state()
else:
+ machine_hashes = []
for machine in machines:
end_point = EndPoint(machine, state='UNKNOWN')
h = end_point.make_hash()
+ machine_hashes.append(h)
if h not in self.endpoints.state:
self.logger.debug(
'***** detected new address {0}'.format(machine))
self.endpoints.set(end_point)
+ endpoint_hashes = self.endpoints.state.copy()
+ for endpoint in endpoint_hashes:
+ if endpoint not in machine_hashes:
+ del self.endpoints.state[endpoint]
def update_endpoint_state(self, messages=None):
'''Handles Get requests'''
