From d8d7d148fe2c185f2efda0c4cfc2ca125d4008d7 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Mon, 11 Mar 2013 13:13:11 -0400 Subject: Pass migration_ref when when auto-confirming The _poll_unconfirmed_resizes() task in compute/manager calls back to compute_api to confirm resizes. This triggers a db lookup for the migration, which is not allowed by no-db-compute. Since we already have the migration, pass it through to avoid the lookup. Since this doesn't change rpcapi (and thus, RPC clients should not know about this optional paramter), we don't need to bump the RPC version here. Fixes bug 1152792 Change-Id: I4bd3b0c88968ed7f64e7df0afa12e83009ee8ccf --- nova/tests/compute/test_compute.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py index e94d8b788..0e41678b3 100644 --- a/nova/tests/compute/test_compute.py +++ b/nova/tests/compute/test_compute.py @@ -3414,13 +3414,15 @@ class ComputeTestCase(BaseTestCase): if migration['id'] == m['id']: migration['status'] = status - def fake_confirm_resize(context, instance): + def fake_confirm_resize(context, instance, migration_ref=None): # raise exception for 'fake_uuid4' to check migration status # does not get set to 'error' on confirm_resize failure. if instance['uuid'] == 'fake_uuid4': raise test.TestingException + self.assertNotEqual(migration_ref, None) for migration in migrations: - if migration['instance_uuid'] == instance['uuid']: + if (migration['instance_uuid'] == + migration_ref['instance_uuid']): migration['status'] = 'confirmed' self.stubs.Set(db, 'instance_get_by_uuid', -- cgit