diff options
| author | Soren Hansen <soren.hansen@rackspace.com> | 2010-09-27 13:23:39 +0200 |
|---|---|---|
| committer | Soren Hansen <soren.hansen@rackspace.com> | 2010-09-27 13:23:39 +0200 |
| commit | 04fa25e63bf37222d2b1cf88837f1c85cf944f54 (patch) | |
| tree | 79c48ff313456c411a5365f17579dfd5aca86b14 | |
| parent | 928df580e5973bc1fd3871a0aa31886302bb9268 (diff) | |
Only call _on_set_network_host on nova-network hosts.
| -rw-r--r-- | nova/network/manager.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/nova/network/manager.py b/nova/network/manager.py index c17823f1e..2530f04b7 100644 --- a/nova/network/manager.py +++ b/nova/network/manager.py @@ -80,10 +80,13 @@ class NetworkManager(manager.Manager): network_driver = FLAGS.network_driver self.driver = utils.import_object(network_driver) super(NetworkManager, self).__init__(*args, **kwargs) - # Set up networking for the projects for which we're already - # the designated network host. - for network in self.db.host_get_networks(None, host=kwargs['host']): - self._on_set_network_host(None, network['id']) + # Host only gets passed if being instantiated as part of the network + # service. + if 'host' in kwargs: + # Set up networking for the projects for which we're already + # the designated network host. + for network in self.db.host_get_networks(None, host=kwargs['host']): + self._on_set_network_host(None, network['id']) def set_network_host(self, context, project_id): """Safely sets the host of the projects network""" |
