diff options
author | Giampaolo Lauria <lauria@us.ibm.com> | 2013-02-22 09:50:30 -0500 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-02-26 01:09:28 +0000 |
commit | 785861e30e8fd483dd4b81a24721c39f2a2c2905 (patch) | |
tree | f67db2db9e4c521f4d0ffe99333be7a41e0248d7 | |
parent | d9bbcfb76646cb77d9dfc867f057917b3e059a4f (diff) | |
download | nova-785861e30e8fd483dd4b81a24721c39f2a2c2905.tar.gz nova-785861e30e8fd483dd4b81a24721c39f2a2c2905.tar.xz nova-785861e30e8fd483dd4b81a24721c39f2a2c2905.zip |
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
-rw-r--r-- | nova/compute/rpcapi.py | 6 |
1 files 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) |