summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorDan Smith <danms@us.ibm.com>2013-03-11 13:13:11 -0400
committerDan Smith <danms@us.ibm.com>2013-03-11 13:13:11 -0400
commitd8d7d148fe2c185f2efda0c4cfc2ca125d4008d7 (patch)
tree5fbcf02449e2fbd38f11f2765403cad4eef4b312 /nova/tests
parentf543f347c84e7f5de2c584ca55363e4dee5b0a3d (diff)
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
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/compute/test_compute.py6
1 files changed, 4 insertions, 2 deletions
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',