iterate over timestamps
@@ -581,10 +581,12 @@ class SDNConnect(object):
]
self.logger.debug("{0}".format(json.dumps(mac_addresses, indent=2)))
#make history entries for any changed prop
+ for timestamp in mac_addresses:
for field in fields:
- if field['field_name'] in mac_addresses and endpoint.endpoint_data.mac_addresses['field_name'] != mac_addresses['field_name']:
+ mac = mac_addresses[timestamp]
+ if field['field_name'] in mac and endpoint.endpoint_data.mac_addresses[field['field_name']] != mac[field['field_name']]:
endpoint.update_property_history(field['entry_type'], field['field_name'], endpoint.endpoint_data.mac_addresses['field_name'],
- mac_addresses[field['field_name']])
+ mac[field['field_name']])
endpoint.metadata = {
'mac_addresses': mac_addresses,
