]> git.apps.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:14:48 +0000 (16:14 -0400)
commitbb902fc58b9ac22e28501daeb77b2d43151f3d02
treefc05245e6a0f5fda8bfd55614c4f656a89d6b72b
parentfb620d1973142e75441129ba7755ea8b71888d7b
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