also for update
@@ -423,9 +423,12 @@ class UpdateR(object):
return
try:
r.hmset(payload['id'], metadata)
- r.hmset(metadata['endpoint_data']['ip-address'],
+ r.hmset(metadata['endpoint_data']['mac'],
{'poseidon_hash': payload['id']})
- r.sadd('ip_addresses', metadata['endpoint_data']['ip-address'])
+ r.sadd('mac_addresses', metadata['endpoint_data']['mac'])
+ if metadata['endpoint_data']['ip_address'] != 'None':
+ r.sadd('ip_addresses',
+ metadata['endpoint_data']['ip-address'])
except Exception as e: # pragma: no cover
resp.body = "(False, 'unable to store contents of the payload [ " + str(
metadata) + ' ] in redis because: ' + str(e) + "')"
