]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Remove dead code from test_get_volume_stats()
authorJon Bernard <jobernar@redhat.com>
Fri, 15 Nov 2013 22:38:31 +0000 (17:38 -0500)
committerJon Bernard <jobernar@redhat.com>
Thu, 21 Nov 2013 23:12:36 +0000 (18:12 -0500)
The _emulate_vgs_execute() routine is never called because the function
that calls it (get_all_volume_groups) is overridden to return fake
output without executing vgs.

Change-Id: I3d3f536f7d85128547dc9e758e3930412ebed121

cinder/tests/test_volume.py

index ec522de5e2328abe247cefde98a1f49f5a8c6e2c..bbdea1d80e9b698a96dd32c62a5b6ccc84f210e3 100644 (file)
@@ -2330,10 +2330,6 @@ class ISCSITestCase(DriverTestCase):
         self.assertEqual(result["target_lun"], 0)
 
     def test_get_volume_stats(self):
-        def _emulate_vgs_execute(_command, *_args, **_kwargs):
-            out = "  test1-volumes  5,52  0,52"
-            out += " test2-volumes  5.52  0.52"
-            return out, None
 
         def _fake_get_all_volume_groups(obj, vg_name=None, no_suffix=True):
             return [{'name': 'cinder-volumes',
@@ -2345,7 +2341,6 @@ class ISCSITestCase(DriverTestCase):
         self.stubs.Set(brick_lvm.LVM,
                        'get_all_volume_groups',
                        _fake_get_all_volume_groups)
-        self.volume.driver.set_execute(_emulate_vgs_execute)
         self.volume.driver.vg = brick_lvm.LVM('cinder-volumes', 'sudo')
 
         self.volume.driver._update_volume_stats()