From 430d3a5b94543e3b24a58d61d1497b3683ff309e Mon Sep 17 00:00:00 2001 From: Jon Bernard Date: Fri, 15 Nov 2013 17:38:31 -0500 Subject: [PATCH] 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 --- cinder/tests/test_volume.py | 5 ----- 1 file changed, 5 deletions(-) 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() -- 2.45.2