diff options
| author | Jason Koelker <jason@koelker.net> | 2011-08-15 15:29:55 -0500 |
|---|---|---|
| committer | Jason Koelker <jason@koelker.net> | 2011-08-15 15:29:55 -0500 |
| commit | d3e2be67d116dcdbe0484a10708ae00d040d2d9f (patch) | |
| tree | 71b261180de563632cec35355cfca3ec4fc963ad | |
| parent | 54ba0d6d25f60b5acb363d141aeba63e4c727c72 (diff) | |
i hate these exceptions where it should just return an empty list
| -rw-r--r-- | nova/network/manager.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nova/network/manager.py b/nova/network/manager.py index 31bb29f81..ddb60ecfa 100644 --- a/nova/network/manager.py +++ b/nova/network/manager.py @@ -656,7 +656,10 @@ class NetworkManager(manager.SchedulerDependentManager): subnets_v4 = list(fixed_net_v4.subnet(prefixlen_v4, count=num_networks)) - nets = self.db.network_get_all(context) + try: + nets = self.db.network_get_all(context) + except exception.NoNetworksFound: + nets = [] used_subnets = [netaddr.IPNetwork(net['cidr']) for net in nets] for subnet in subnets_v4: |
