Skip to content

Commit

Permalink
Merge pull request ceph#32948 from yaarith/wip-telemetry-serial-nauti…
Browse files Browse the repository at this point in the history
…lus-yh

nautilus: mgr/telemetry: fix device serial number anonymization

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Neha Ojha <nojha@redhat.com>
  • Loading branch information
yuriw committed Feb 13, 2020
2 parents f203d8b + b338ffa commit ec1f782
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/pybind/mgr/telemetry/module.py
Expand Up @@ -386,10 +386,9 @@ def gather_device_report(self):
rep['host_id'] = anon_host

# anonymize device id
(vendor, model, serial) = devid.split('_')
anon_devid = self.get_store('devid-id/%s' % devid)
if not anon_devid:
anon_devid = '%s_%s_%s' % (vendor, model, uuid.uuid1())
anon_devid = devid[:devid.rfind('_')] + '_' + uuid.uuid1()
self.set_store('devid-id/%s' % devid, anon_devid)
self.log.info('devid %s / %s, host %s / %s' % (devid, anon_devid,
host, anon_host))
Expand Down Expand Up @@ -515,7 +514,7 @@ def compile_report(self, channels=[]):
for osd in osd_map['osds']:
if osd['up'] and not cluster_network:
front_ip = osd['public_addrs']['addrvec'][0]['addr'].split(':')[0]
back_ip = osd['public_addrs']['addrvec'][0]['addr'].split(':')[0]
back_ip = osd['cluster_addrs']['addrvec'][0]['addr'].split(':')[0]
if front_ip != back_ip:
cluster_network = True
report['osd'] = {
Expand Down Expand Up @@ -609,7 +608,7 @@ def compile_report(self, channels=[]):

report['usage'] = {
'pools': len(df['pools']),
'pg_num:': num_pg,
'pg_num': num_pg,
'total_used_bytes': df['stats']['total_used_bytes'],
'total_bytes': df['stats']['total_bytes'],
'total_avail_bytes': df['stats']['total_avail_bytes']
Expand Down

0 comments on commit ec1f782

Please sign in to comment.