From: Rishabh Dave Date: Mon, 3 Aug 2020 14:15:47 +0000 (+0530) Subject: ceph-volume: remove api.lvm.get_api_lvs() and related tests X-Git-Tag: v16.1.0~1453^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b7ca04dc647b2e7b3b2388c48884af9bd69db2c4;p=ceph.git ceph-volume: remove api.lvm.get_api_lvs() and related tests Signed-off-by: Rishabh Dave --- diff --git a/src/ceph-volume/ceph_volume/api/lvm.py b/src/ceph-volume/ceph_volume/api/lvm.py index cabc7923172..15938e8560f 100644 --- a/src/ceph-volume/ceph_volume/api/lvm.py +++ b/src/ceph-volume/ceph_volume/api/lvm.py @@ -616,24 +616,6 @@ def get_device_vgs(device, name_prefix=''): LV_FIELDS = 'lv_tags,lv_path,lv_name,vg_name,lv_uuid,lv_size' LV_CMD_OPTIONS = ['--noheadings', '--readonly', '--separator=";"', '-a'] -def get_api_lvs(): - """ - Return the list of logical volumes available in the system using flags to include common - metadata associated with them - - Command and delimited output should look like:: - - $ lvs --noheadings --readonly --separator=';' -a -o lv_tags,lv_path,lv_name,vg_name - ;/dev/ubuntubox-vg/root;root;ubuntubox-vg - ;/dev/ubuntubox-vg/swap_1;swap_1;ubuntubox-vg - - """ - stdout, stderr, returncode = process.call( - ['lvs'] + LV_CMD_OPTIONS + ['-o', LV_FIELDS], - verbose_on_failure=False - ) - return _output_parser(stdout, LV_FIELDS) - class Volume(object): """ diff --git a/src/ceph-volume/ceph_volume/tests/api/test_lvm.py b/src/ceph-volume/ceph_volume/tests/api/test_lvm.py index c3df9c6c676..5d833c86c21 100644 --- a/src/ceph-volume/ceph_volume/tests/api/test_lvm.py +++ b/src/ceph-volume/ceph_volume/tests/api/test_lvm.py @@ -31,26 +31,6 @@ class TestParseTags(object): assert result['ceph.fsid'] == '0000' -class TestGetAPILvs(object): - - def test_report_is_emtpy(self, monkeypatch): - monkeypatch.setattr(api.process, 'call', lambda x, **kw: ('', '', 0)) - assert api.get_api_lvs() == [] - - def test_report_has_stuff(self, monkeypatch): - report = [' ;/path;VolGroup00;root'] - monkeypatch.setattr(api.process, 'call', lambda x, **kw: (report, '', 0)) - result = api.get_api_lvs() - assert result[0]['lv_name'] == 'VolGroup00' - - def test_report_has_multiple_items(self, monkeypatch): - report = [' ;/path;VolName;root', ';/dev/path;ceph_lv;ceph_vg'] - monkeypatch.setattr(api.process, 'call', lambda x, **kw: (report, '', 0)) - result = api.get_api_lvs() - assert result[0]['lv_name'] == 'VolName' - assert result[1]['lv_name'] == 'ceph_lv' - - class TestVolume(object): def test_is_ceph_device(self):