update to use mac as the key
@@ -84,10 +84,14 @@ class CreateR(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('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) + "')"
