From: Jon Bernard Date: Fri, 15 Nov 2013 22:38:31 +0000 (-0500) Subject: Remove dead code from test_get_volume_stats() X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=430d3a5b94543e3b24a58d61d1497b3683ff309e;p=openstack-build%2Fcinder-build.git Remove dead code from test_get_volume_stats() 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 --- diff --git a/cinder/tests/test_volume.py b/cinder/tests/test_volume.py index ec522de5e..bbdea1d80 100644 --- a/cinder/tests/test_volume.py +++ b/cinder/tests/test_volume.py @@ -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()