From f9a84812acbbf9a15f8e05e3fc3777d4b7c2f66b Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Thu, 8 Nov 2012 10:54:23 -0500 Subject: Simplify topic handling in network rpcapi. rpc.queue_get_for() can now handle host=None. Simplify some of the topic handling logic in the network rpcapi to take advantage of this. Change-Id: I1fc5b2e7370f7c5440bd4beaae007a2126e9f645 --- nova/network/rpcapi.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/nova/network/rpcapi.py b/nova/network/rpcapi.py index eba0aae52..b7e9cd70b 100644 --- a/nova/network/rpcapi.py +++ b/nova/network/rpcapi.py @@ -268,10 +268,7 @@ class NetworkAPI(rpc_proxy.RpcProxy): def migrate_instance_start(self, ctxt, instance_uuid, rxtx_factor, project_id, source_compute, dest_compute, floating_addresses, host=None): - if host is not None: - topic = rpc.queue_get_for(ctxt, self.topic, host) - else: - topic = self.topic + topic = rpc.queue_get_for(ctxt, self.topic, host) return self.call(ctxt, self.make_msg( 'migrate_instance_start', instance_uuid=instance_uuid, @@ -286,10 +283,7 @@ class NetworkAPI(rpc_proxy.RpcProxy): def migrate_instance_finish(self, ctxt, instance_uuid, rxtx_factor, project_id, source_compute, dest_compute, floating_addresses, host=None): - if host is not None: - topic = rpc.queue_get_for(ctxt, self.topic, host) - else: - topic = self.topic + topic = rpc.queue_get_for(ctxt, self.topic, host) return self.call(ctxt, self.make_msg( 'migrate_instance_finish', instance_uuid=instance_uuid, -- cgit