]> 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)
committerErwan Velu <erwan@redhat.com>
Mon, 22 Oct 2018 09:56:14 +0000 (11:56 +0200)
commitd8fdf0b7532cdffcae56511c377679e51841caec
tree0509f2bda79630566d8a30ee203cdd9fa6b3f1a2
parent98fc7ebc99a3639240eef4f745c9bd633446d2b3
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>
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