From ec75cc2a6bc6e3f367b3377515cb9c4b99a6ab29 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Fri, 29 Mar 2013 09:19:57 -0700 Subject: Fix automatic confirmation of resizes for no-db-compute compute/api.py:confirm_resize() was still making a bunch of calls against the database that were tripping over the no-db-compute enforcement checks. Instead of trying to unwind all of the instance action, quota, etc code and divert to conductor, just farm out the entire confirm_resize() call to conductor. Fixes bug 1161402 Change-Id: I121040a3b575f5866d45cc8ef6862d67f5558715 --- nova/tests/compute/test_compute.py | 2 +- nova/tests/conductor/test_conductor.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'nova/tests') diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py index 3a1526522..b27c079a2 100644 --- a/nova/tests/compute/test_compute.py +++ b/nova/tests/compute/test_compute.py @@ -3654,7 +3654,7 @@ class ComputeTestCase(BaseTestCase): fake_migration_get_unconfirmed_by_dest_compute) self.stubs.Set(self.compute.conductor_api, 'migration_update', fake_migration_update) - self.stubs.Set(self.compute.compute_api, 'confirm_resize', + self.stubs.Set(self.compute.conductor_api, 'compute_confirm_resize', fake_confirm_resize) def fetch_instance_migration_status(instance_uuid): diff --git a/nova/tests/conductor/test_conductor.py b/nova/tests/conductor/test_conductor.py index df0f5e73b..1c675ec61 100644 --- a/nova/tests/conductor/test_conductor.py +++ b/nova/tests/conductor/test_conductor.py @@ -599,6 +599,16 @@ class _BaseTestCase(object): self.mox.ReplayAll() self.conductor.compute_stop(self.context, 'instance') + def test_compute_confirm_resize(self): + self.mox.StubOutWithMock(self.conductor_manager.compute_api, + 'confirm_resize') + self.conductor_manager.compute_api.confirm_resize(self.context, + 'instance', + 'migration') + self.mox.ReplayAll() + self.conductor.compute_confirm_resize(self.context, 'instance', + 'migration') + class ConductorTestCase(_BaseTestCase, test.TestCase): """Conductor Manager Tests.""" -- cgit