fix check for valid
@@ -676,7 +676,7 @@ class Monitor(object):
extras = deepcopy(ml_returns)
# process results from ml output and update impacted endpoints
for ep in self.s.endpoints:
- if ep.name in ml_returns or ('valid' in ml_returns[ep.name] and ml_returns[ep.name]['valid'] == 'false'):
+ if ep.name in ml_returns:
del extras[ep.name]
if ep.name in ml_returns and 'valid' in ml_returns[ep.name] and not ep.ignore:
if ep.state in ['mirroring', 'reinvestigating']:
@@ -700,6 +700,7 @@ class Monitor(object):
(ep.state, int(time.time())))
extra_machines = []
for device in extras:
+ if extras[device]['valid'] == 'true':
extra_machine = {'mac': extras[device]['source_mac'], 'segment': 'NO DATA',
'port': 'NO DATA', 'tenant': 'NO DATA', 'active': 0, 'name': device}
if ':' in extras[device]['source_ip']:
