diff options
| author | Dan Smith <danms@us.ibm.com> | 2013-02-12 12:34:39 -0500 |
|---|---|---|
| committer | Dan Smith <danms@us.ibm.com> | 2013-02-12 18:18:33 -0500 |
| commit | 959e65f320093a6b17945f52ad160da5aa042ff6 (patch) | |
| tree | a521c2499b7b8530eb9725c9f3aa89368f08cac1 /nova/tests | |
| parent | 9994a9161d0acac216b3441233eae1f7238db889 (diff) | |
Make compute manager use conductor for stopping instances
During _sync_power_states, the manager will call to compute_api to
stop instances as necessary. This takes a database hit, which isn't
allowed. This directs that call through conductor, following the
pattern of late.
Fixes bug 1123219
Change-Id: I5d789dd73390cb1c41a245f6594b1c3aecf7efde
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/conductor/test_conductor.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nova/tests/conductor/test_conductor.py b/nova/tests/conductor/test_conductor.py index 41554e79a..ed733599b 100644 --- a/nova/tests/conductor/test_conductor.py +++ b/nova/tests/conductor/test_conductor.py @@ -580,6 +580,12 @@ class _BaseTestCase(object): result = self.conductor.get_ec2_ids(self.context, inst) self.assertEqual(result, expected) + def test_compute_stop(self): + self.mox.StubOutWithMock(self.conductor_manager.compute_api, 'stop') + self.conductor_manager.compute_api.stop(self.context, 'instance', True) + self.mox.ReplayAll() + self.conductor.compute_stop(self.context, 'instance') + class ConductorTestCase(_BaseTestCase, test.TestCase): """Conductor Manager Tests.""" |
