Better to fully obfuscate here.
This has a nice side-effect of assigning entity names that are *globally*
unique across the full telemetry data set, since the salts are unique and
sha1 is (sufficiently) collision-free.
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit
753174cdaed1fcfdb123c06dc20b699f324442cc)
c = json.loads(crashinfo)
del c['utsname_hostname']
(etype, eid) = c.get('entity_name', '').split('.')
- if etype != 'osd':
- m = hashlib.sha1()
- m.update(self.salt.encode('utf-8'))
- m.update(eid.encode('utf-8'))
- m.update(self.salt.encode('utf-8'))
- c['entity_name'] = etype + '.' + m.hexdigest()
+ m = hashlib.sha1()
+ m.update(self.salt.encode('utf-8'))
+ m.update(eid.encode('utf-8'))
+ m.update(self.salt.encode('utf-8'))
+ c['entity_name'] = etype + '.' + m.hexdigest()
crashlist.append(c)
return crashlist