From 785861e30e8fd483dd4b81a24721c39f2a2c2905 Mon Sep 17 00:00:00 2001 From: Giampaolo Lauria Date: Fri, 22 Feb 2013 09:50:30 -0500 Subject: Minor code optimization in _compute_topic In cases where a valid host is passed, the if statement is always executed twice, not once like it should Change-Id: I6a24bb4f85bfb94d2fdc5d1652ee371f296a10ef --- nova/compute/rpcapi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nova/compute/rpcapi.py b/nova/compute/rpcapi.py index 67dfc6a6b..914c45471 100644 --- a/nova/compute/rpcapi.py +++ b/nova/compute/rpcapi.py @@ -50,9 +50,9 @@ def _compute_topic(topic, ctxt, host, instance): if not instance: raise exception.NovaException(_('No compute host specified')) host = instance['host'] - if not host: - raise exception.NovaException(_('Unable to find host for ' - 'Instance %s') % instance['uuid']) + if not host: + raise exception.NovaException(_('Unable to find host for ' + 'Instance %s') % instance['uuid']) return rpc.queue_get_for(ctxt, topic, host) -- cgit