]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-volume: remove api.lvm.get_api_lvs() and related tests
authorRishabh Dave <ridave@redhat.com>
Mon, 3 Aug 2020 14:15:47 +0000 (19:45 +0530)
committerRishabh Dave <ridave@redhat.com>
Mon, 10 Aug 2020 08:09:41 +0000 (13:39 +0530)
Signed-off-by: Rishabh Dave <ridave@redhat.com>
src/ceph-volume/ceph_volume/api/lvm.py
src/ceph-volume/ceph_volume/tests/api/test_lvm.py

index cabc7923172a64949b30e4bd2f98df6ed32411a1..15938e8560f2a3e36a7c3b64e67a33e8dc16b6e1 100644 (file)
@@ -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):
     """
index c3df9c6c676329f02ad6083b49847e2d64f6b5fe..5d833c86c21f8219a3cf8e371df7af38097ae603 100644 (file)
@@ -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):