]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/telemetry: fix device id splitting when anonymizing serial 36855/head
authorYaarit Hatuka <yaarit@redhat.com>
Thu, 27 Aug 2020 03:04:34 +0000 (23:04 -0400)
committerYaarit Hatuka <yaarit@redhat.com>
Thu, 27 Aug 2020 03:16:25 +0000 (23:16 -0400)
commite5099a7b58bcf39d80beb908c192c3bf639db1a4
treebc659212de535b4dfe0be1f51241ab74f9898ded
parentd2a3fcc728c31b25166aeb55c99b9ccf8d4985bb
mgr/telemetry: fix device id splitting when anonymizing serial

Anonymizing the serial number in the device id string fails in rare
cases where 'vendor' and 'model' are missing from the device id
string. Ideally, device id is generated (in blkdev.cc) as
'vendor_model_serial', in case all fields were successfully retrieved
from the device. In cases where they were not, device id can also be
generated as 'model_serial' or 'serial'. Splitting by '_' fails in the
latter case (since 'serial' is the only element in the string).

In order to anonymize serial numbers in smartctl reports we now rely
on the serial number value as retrieved from the raw smartctl report
itself (as opposed to the one in device id). That's in order to avoid
possible inconsistencies between the serial retrieved from device id and
the one in the report.

Fixes: https://tracker.ceph.com/issues/46977
Signed-off-by: Yaarit Hatuka <yaarit@redhat.com>
src/pybind/mgr/telemetry/module.py