From 54bc59520fe8041f48b22bbe8c3ce11a2943aa84 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Thu, 26 Nov 2015 23:40:25 -0600 Subject: [PATCH] Cleanup orphaned code from brick LVM There were several methods in the brick lvm code that were no longer being used anywhere. While some of these have potential for being useful, they are not in use and should not be sitting around the codebase waiting for someone to need them. This patch removes unused methods as well as their associated unit tests. Change-Id: Ib3aba7b6b51a525855c5357e4164478f26e9ee98 --- cinder/brick/local_dev/lvm.py | 21 --------------------- cinder/tests/unit/brick/fake_lvm.py | 3 --- cinder/tests/unit/brick/test_brick_lvm.py | 8 -------- 3 files changed, 32 deletions(-) diff --git a/cinder/brick/local_dev/lvm.py b/cinder/brick/local_dev/lvm.py index 6b5c0a7b5..ac2e5672e 100644 --- a/cinder/brick/local_dev/lvm.py +++ b/cinder/brick/local_dev/lvm.py @@ -138,17 +138,6 @@ class LVM(executor.Executor): cmd = ['vgcreate', self.vg_name, ','.join(pv_list)] self._execute(*cmd, root_helper=self._root_helper, run_as_root=True) - def _get_vg_uuid(self): - cmd = LVM.LVM_CMD_PREFIX + ['vgs', '--noheadings', - '-o', 'uuid', self.vg_name] - (out, _err) = self._execute(*cmd, - root_helper=self._root_helper, - run_as_root=True) - if out is not None: - return out.split() - else: - return [] - def _get_thin_pool_free_space(self, vg_name, thin_pool_name): """Returns available thin pool free space. @@ -352,16 +341,6 @@ class LVM(executor.Executor): 'available': float(fields[3])}) return pv_list - def get_physical_volumes(self): - """Get all PVs associated with this instantiation (VG). - - :returns: List of Dictionaries with PV info - - """ - self.pv_list = self.get_all_physical_volumes(self._root_helper, - self.vg_name) - return self.pv_list - @staticmethod def get_all_volume_groups(root_helper, vg_name=None): """Static method to get all VGs on a system. diff --git a/cinder/tests/unit/brick/fake_lvm.py b/cinder/tests/unit/brick/fake_lvm.py index 8474b9c93..9660ffdc1 100644 --- a/cinder/tests/unit/brick/fake_lvm.py +++ b/cinder/tests/unit/brick/fake_lvm.py @@ -31,9 +31,6 @@ class FakeBrickLVM(object): def get_all_physical_volumes(vg_name=None): return [] - def get_physical_volumes(self): - return [] - def update_volume_group_info(self): pass diff --git a/cinder/tests/unit/brick/test_brick_lvm.py b/cinder/tests/unit/brick/test_brick_lvm.py index 6f97267fb..67a995019 100644 --- a/cinder/tests/unit/brick/test_brick_lvm.py +++ b/cinder/tests/unit/brick/test_brick_lvm.py @@ -168,10 +168,6 @@ class BrickLvmTestCase(test.TestCase): def test_vg_exists(self): self.assertTrue(self.vg._vg_exists()) - def test_get_vg_uuid(self): - self.assertEqual('kVxztV-dKpG-Rz7E-xtKY-jeju-QsYU-SLG6Z1', - self.vg._get_vg_uuid()[0]) - def test_get_all_volumes(self): out = self.vg.get_volumes() @@ -227,10 +223,6 @@ class BrickLvmTestCase(test.TestCase): pvs = self.vg.get_all_physical_volumes('sudo') self.assertEqual(4, len(pvs)) - def test_get_physical_volumes(self): - pvs = self.vg.get_physical_volumes() - self.assertEqual(3, len(pvs)) - def test_get_volume_groups(self): self.assertEqual(3, len(self.vg.get_all_volume_groups('sudo'))) self.assertEqual(1,