summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrey Morris <trey.morris@rackspace.com>2011-07-20 17:49:23 +0000
committerTarmac <>2011-07-20 17:49:23 +0000
commitf47e59e3b5cee88f15b2d22a555119d65dcbe3eb (patch)
tree8f793c5367d12d52c44b400e018a0ea4b181b625
parent9f7cbe0c667eb7490b81bb46223ce9ef6acdfebf (diff)
parentd8132fd792d3316420033435a43604f7e09cfcdb (diff)
downloadnova-f47e59e3b5cee88f15b2d22a555119d65dcbe3eb.tar.gz
nova-f47e59e3b5cee88f15b2d22a555119d65dcbe3eb.tar.xz
nova-f47e59e3b5cee88f15b2d22a555119d65dcbe3eb.zip
lp812489: better handling of periodic network host setup to prevent exception
-rw-r--r--nova/network/manager.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/nova/network/manager.py b/nova/network/manager.py
index 24736f53d..33cf86e37 100644
--- a/nova/network/manager.py
+++ b/nova/network/manager.py
@@ -334,21 +334,21 @@ class NetworkManager(manager.SchedulerDependentManager):
self.host)
if host == self.host:
self._on_set_network_host(context, network_id)
- return host
def set_network_hosts(self, context):
"""Set the network hosts for any networks which are unset."""
try:
networks = self.db.network_get_all(context)
except exception.NoNetworksFound:
- # we don't care if no networks are found
- pass
+ # no networks found, nothing to do
+ return
for network in networks:
host = network['host']
if not host:
- # return so worker will only grab 1 (to help scale flatter)
- return self.set_network_host(context, network['id'])
+ # break so worker will only grab 1 (to help scale flatter)
+ self.set_network_host(context, network['id'])
+ break
def _get_networks_for_instance(self, context, instance_id, project_id):
"""Determine & return which networks an instance should connect to."""