diff options
| author | Trey Morris <trey.morris@rackspace.com> | 2011-07-11 15:49:41 -0500 |
|---|---|---|
| committer | Trey Morris <trey.morris@rackspace.com> | 2011-07-11 15:49:41 -0500 |
| commit | 5ba19f7d7d9e624be5aebce496f88120ea1175e4 (patch) | |
| tree | 88618fe9822b68c618d89f7c8f4778b0dc7adb68 | |
| parent | d682fb4431050d97f09fb9677f6dc8d242e68d74 (diff) | |
catch raise for networks not found in network host and instance setup
| -rw-r--r-- | nova/network/manager.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/nova/network/manager.py b/nova/network/manager.py index d42bc8c4e..d7ac460ae 100644 --- a/nova/network/manager.py +++ b/nova/network/manager.py @@ -336,7 +336,12 @@ class NetworkManager(manager.SchedulerDependentManager): def set_network_hosts(self, context): """Set the network hosts for any networks which are unset.""" - networks = self.db.network_get_all(context) + try: + networks = self.db.network_get_all(context) + except Exception.NoNetworksFound: + # we don't care if no networks are found + pass + for network in networks: host = network['host'] if not host: @@ -348,7 +353,11 @@ class NetworkManager(manager.SchedulerDependentManager): # TODO(tr3buchet) maybe this needs to be updated in the future if # there is a better way to determine which networks # a non-vlan instance should connect to - networks = self.db.network_get_all(context) + try: + networks = self.db.network_get_all(context) + except Exception.NoNetworksFound: + # we don't care if no networks are found + pass # return only networks which are not vlan networks and have host set return [network for network in networks if |
