From 96134f9e34faf7e4be1776b24c8d8d661a23342a Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Fri, 27 Jul 2012 11:58:19 -0400 Subject: Send a full instance in remove_fixed_ip_from_instance. Change the remove_fixed_ip_from_instance 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: Iee0daf068be9814ef0ba06a69111a45a2e198cbb --- nova/tests/compute/test_compute.py | 7 +++---- nova/tests/compute/test_rpcapi.py | 5 +++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py index 8ce9212d7..87de08998 100644 --- a/nova/tests/compute/test_compute.py +++ b/nova/tests/compute/test_compute.py @@ -888,13 +888,12 @@ class ComputeTestCase(BaseTestCase): self.stubs.Set(nova.compute.manager.ComputeManager, 'reset_network', dummy) - instance = self._create_fake_instance() + instance = jsonutils.to_primitive(self._create_fake_instance()) instance_uuid = instance['uuid'] self.assertEquals(len(test_notifier.NOTIFICATIONS), 0) - self.compute.remove_fixed_ip_from_instance(self.context, - instance_uuid, - 1) + self.compute.remove_fixed_ip_from_instance(self.context, 1, + instance=instance) self.assertEquals(len(test_notifier.NOTIFICATIONS), 2) self.compute.terminate_instance(self.context, instance_uuid) diff --git a/nova/tests/compute/test_rpcapi.py b/nova/tests/compute/test_rpcapi.py index 79b33f25d..e081c1455 100644 --- a/nova/tests/compute/test_rpcapi.py +++ b/nova/tests/compute/test_rpcapi.py @@ -57,7 +57,8 @@ class ComputeRpcAPITestCase(test.TestCase): 'inject_file', 'inject_network_info', 'pause_instance', 'post_live_migration_at_destination', 'power_off_instance', 'power_on_instance', 'pre_live_migration', 'reboot_instance', - 'rebuild_instance', 'start_instance', 'stop_instance', + 'rebuild_instance', 'remove_fixed_ip_from_instance', + 'start_instance', 'stop_instance', 'suspend_instance', 'unpause_instance' ] @@ -257,7 +258,7 @@ class ComputeRpcAPITestCase(test.TestCase): def test_remove_fixed_ip_from_instance(self): self._test_compute_api('remove_fixed_ip_from_instance', 'cast', - instance=self.fake_instance, address='addr') + instance=self.fake_instance, address='addr', version='1.25') def test_remove_volume_connection(self): self._test_compute_api('remove_volume_connection', 'call', -- cgit