diff options
author | Erwan Velu <erwan@redhat.com> | 2018-10-09 21:04:02 +0200 |
---|---|---|
committer | Erwan Velu <erwan@redhat.com> | 2018-10-22 11:56:14 +0200 |
commit | d8fdf0b7532cdffcae56511c377679e51841caec (patch) | |
tree | 0509f2bda79630566d8a30ee203cdd9fa6b3f1a2 /src/ceph-volume/ceph_volume/tests/util/test_disk.py | |
parent | Merge PR #24184 into master (diff) | |
download | ceph-d8fdf0b7532cdffcae56511c377679e51841caec.tar.xz ceph-d8fdf0b7532cdffcae56511c377679e51841caec.zip |
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>
Diffstat (limited to 'src/ceph-volume/ceph_volume/tests/util/test_disk.py')
-rw-r--r-- | src/ceph-volume/ceph_volume/tests/util/test_disk.py | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/src/ceph-volume/ceph_volume/tests/util/test_disk.py b/src/ceph-volume/ceph_volume/tests/util/test_disk.py index fd3839307e8..5d1bd82b602 100644 --- a/src/ceph-volume/ceph_volume/tests/util/test_disk.py +++ b/src/ceph-volume/ceph_volume/tests/util/test_disk.py @@ -220,19 +220,6 @@ class TestGetDevices(object): assert result[dev_sda_path]['model'] == '' assert result[dev_sda_path]['partitions'] == {} - def test_sda_is_removable_gets_skipped(self, tmpfile, tmpdir): - block_path, dev_path, mapper_path = self.setup_paths(tmpdir) - dev_sda_path = os.path.join(dev_path, 'sda') - block_sda_path = os.path.join(block_path, 'sda') - os.makedirs(block_sda_path) - os.makedirs(dev_sda_path) - - tmpfile('removable', contents='1', directory=block_sda_path) - result = disk.get_devices( - _sys_block_path=block_path, - _dev_path=dev_path, - _mapper_path=mapper_path) - assert result == {} def test_dm_device_is_not_used(self, monkeypatch, tmpdir): # the link to the mapper is used instead |