]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common/blkdev: handle devices with ID_MODEL as "LVM PV ..." but valid ID_MODEL_ENC 27096/head
authorSage Weil <sage@redhat.com>
Fri, 15 Mar 2019 22:12:34 +0000 (17:12 -0500)
committerSage Weil <sage@redhat.com>
Fri, 22 Mar 2019 09:53:02 +0000 (04:53 -0500)
commit53e56218f9594ce0fe8cad2c144f5a8e74f10342
tree17905ad820fcc6180180644db9d6e0a944fe52a6
parent0596ea70002463390c4c76f7a212131aa4cdfb20
common/blkdev: handle devices with ID_MODEL as "LVM PV ..." but valid ID_MODEL_ENC

Some devices appear like so:

E: ID_MODEL=LVM PV LUClYG-Oyte-jcM6-npfZ-ncsl-ycL0-bkOH0m on /dev/sdn
E: ID_MODEL_ENC=WDC\x20WDS200T2B0A-00SM50\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
E: ID_SERIAL=WDC_WDS200T2B0A-00SM50_183503800168
E: ID_SERIAL_SHORT=183503800168

To avoid upsetting our prioritization, defer to ID_MODEL_ENC over ID_MODEL
if ID_MODEL has "LVM PV" in it (as opposed to just using ID_SERIAL).

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit de565dd2420f2d2a4a4f6fd12b0bc48af87a4e7d)
src/ceph-volume/ceph_volume/util/device.py
src/common/blkdev.cc
src/common/blkdev.h
src/test/common/blkdev-udevadm-info-samples/cpach.sdn [new file with mode: 0644]
src/test/common/blkdev-udevadm-info-samples/cpach.sdn.devid [new file with mode: 0644]
src/test/common/test_blkdev.cc