]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: remove api.lvm.get_api_vgs() and related tests
authorRishabh Dave <ridave@redhat.com>
Mon, 3 Aug 2020 14:14:48 +0000 (19:44 +0530)
committerRishabh Dave <ridave@redhat.com>
Thu, 13 Aug 2020 13:47:52 +0000 (19:17 +0530)
Signed-off-by: Rishabh Dave <ridave@redhat.com>
(cherry picked from commit ab7a2c3df8a9997c693fdd6ace38b89c67650197)

src/ceph-volume/ceph_volume/api/lvm.py
src/ceph-volume/ceph_volume/tests/api/test_lvm.py

index 2a3a5e73b7417e26a1b969737b269d90f879f982..cabc7923172a64949b30e4bd2f98df6ed32411a1 100644 (file)
@@ -401,27 +401,6 @@ VG_FIELDS = 'vg_name,pv_count,lv_count,vg_attr,vg_extent_count,vg_free_count,vg_
 VG_CMD_OPTIONS = ['--noheadings', '--readonly', '--units=b', '--nosuffix', '--separator=";"']
 
 
-def get_api_vgs():
-    """
-    Return the list of group volumes available in the system using flags to
-    include common metadata associated with them
-
-    Command and sample delimited output should look like::
-
-        $ vgs --noheadings --units=b --readonly --separator=';' \
-          -o vg_name,pv_count,lv_count,vg_attr,vg_free_count,vg_extent_size
-          ubuntubox-vg;1;2;wz--n-;12;
-
-    To normalize sizing, the units are forced in 'g' which is equivalent to
-    gigabytes, which uses multiples of 1024 (as opposed to 1000)
-    """
-    stdout, stderr, returncode = process.call(
-        ['vgs'] + VG_CMD_OPTIONS + ['-o', VG_FIELDS],
-        verbose_on_failure=False
-    )
-    return _output_parser(stdout, VG_FIELDS)
-
-
 class VolumeGroup(object):
     """
     Represents an LVM group, with some top-level attributes like ``vg_name``
index 9a2c32d081113da1bdc3ea7de35984444cbfd9d9..c3df9c6c676329f02ad6083b49847e2d64f6b5fe 100644 (file)
@@ -31,33 +31,6 @@ class TestParseTags(object):
         assert result['ceph.fsid'] == '0000'
 
 
-class TestGetAPIVgs(object):
-
-    def test_report_is_emtpy(self, monkeypatch):
-        monkeypatch.setattr(api.process, 'call', lambda x,**kw: ('\n\n', '', 0))
-        assert api.get_api_vgs() == []
-
-    def test_report_has_stuff(self, monkeypatch):
-        report = ['  VolGroup00']
-        monkeypatch.setattr(api.process, 'call', lambda x, **kw: (report, '', 0))
-        assert api.get_api_vgs() == [{'vg_name': 'VolGroup00'}]
-
-    def test_report_has_stuff_with_empty_attrs(self, monkeypatch):
-        report = ['  VolGroup00 ;;;;;;4194304']
-        monkeypatch.setattr(api.process, 'call', lambda x, **kw: (report, '', 0))
-        result = api.get_api_vgs()[0]
-        assert len(result.keys()) == 7
-        assert result['vg_name'] == 'VolGroup00'
-        assert result['vg_extent_size'] == '4194304'
-
-    def test_report_has_multiple_items(self, monkeypatch):
-        report = ['   VolGroup00;;;;;;;', '    ceph_vg;;;;;;;']
-        monkeypatch.setattr(api.process, 'call', lambda x, **kw: (report, '', 0))
-        result = api.get_api_vgs()
-        assert result[0]['vg_name'] == 'VolGroup00'
-        assert result[1]['vg_name'] == 'ceph_vg'
-
-
 class TestGetAPILvs(object):
 
     def test_report_is_emtpy(self, monkeypatch):