]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
ceph_volume: Adding Device.is_valid()
authorErwan Velu <erwan@redhat.com>
Tue, 9 Oct 2018 19:04:02 +0000 (21:04 +0200)
committerAlfredo Deza <adeza@redhat.com>
Fri, 26 Oct 2018 20:23:47 +0000 (16:23 -0400)
commitc2e5f523cee728e8f74223c0b6b0e04beec17146
tree04b956e416bca2de5a596375509dfb1703111339
parentda3b62dd1f64bf024e1d071577e3c024b6021ba5
ceph_volume: Adding Device.is_valid()

A block device can be filtered-out/ignored because it have features that
doesn't match Ceph's expectations.

As of today, the current code was rejected removable devices but it was
pretty hidden from the user, and implicit in the get_devices() function.

This patch is creating a new is_valid() function to perform all the
rejection tests and returns if this device can be used in the Ceph
context or not.

If is_valid() is returning False, the 'rejected_reasons' list reports all
the reasons why that devices got rejected.

Signed-off-by: Erwan Velu <erwan@redhat.com>
(cherry picked from commit d8fdf0b7532cdffcae56511c377679e51841caec)
src/ceph-volume/ceph_volume/tests/util/test_device.py
src/ceph-volume/ceph_volume/tests/util/test_disk.py
src/ceph-volume/ceph_volume/util/device.py
src/ceph-volume/ceph_volume/util/disk.py