From eba4be81a17ada6da228659db7bad2c346e02db8 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Thu, 26 Jul 2012 12:56:46 -0400 Subject: Send a full instance via rpc for finish_revert_resize. Change the finish_revert_resize method of the compute rpc API to take a full instance over rpc instead of just the instance UUID. This cuts down on database access needed by nova-compute. Part of blueprint no-db-messaging. Change-Id: Ibe2f8b990cc8f2a3d05e8ba8216a1e74cbcfb67b --- nova/tests/compute/test_compute.py | 5 +++-- nova/tests/compute/test_rpcapi.py | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py index 90493b977..591b2ebd4 100644 --- a/nova/tests/compute/test_compute.py +++ b/nova/tests/compute/test_compute.py @@ -1376,8 +1376,9 @@ class ComputeTestCase(BaseTestCase): # Finally, revert and confirm the old flavor has been applied self.compute.revert_resize(context, inst_ref['uuid'], migration_ref['id']) - self.compute.finish_revert_resize(context, inst_ref['uuid'], - migration_ref['id']) + self.compute.finish_revert_resize(context, + migration_id=migration_ref['id'], + instance=jsonutils.to_primitive(inst_ref)) instance = db.instance_get_by_uuid(context, instance['uuid']) self.assertEqual(instance['vm_state'], vm_states.ACTIVE) diff --git a/nova/tests/compute/test_rpcapi.py b/nova/tests/compute/test_rpcapi.py index 6bac3c99f..427acf949 100644 --- a/nova/tests/compute/test_rpcapi.py +++ b/nova/tests/compute/test_rpcapi.py @@ -52,7 +52,8 @@ class ComputeRpcAPITestCase(test.TestCase): 'add_fixed_ip_to_instance', 'attach_volume', 'check_can_live_migrate_destination', 'check_can_live_migrate_source', 'confirm_resize', - 'detach_volume', 'finish_resize', 'get_console_output', + 'detach_volume', 'finish_resize', 'finish_revert_resize', + 'get_console_output', 'pause_instance', 'reboot_instance', 'suspend_instance', 'unpause_instance' ] @@ -166,7 +167,8 @@ class ComputeRpcAPITestCase(test.TestCase): def test_finish_revert_resize(self): self._test_compute_api('finish_revert_resize', 'cast', - instance=self.fake_instance, migration_id='id', host='host') + instance=self.fake_instance, migration_id='id', host='host', + version='1.15') def test_get_console_output(self): self._test_compute_api('get_console_output', 'call', -- cgit