diff options
| author | Brian Lamar <brian.lamar@rackspace.com> | 2011-09-01 15:42:01 -0400 |
|---|---|---|
| committer | Brian Lamar <brian.lamar@rackspace.com> | 2011-09-01 15:42:01 -0400 |
| commit | a36e0a1cbc5645ab47041c2627dba80b39b23cc2 (patch) | |
| tree | 77e1cd5a08cf10145c228d6042adf339db012b8b | |
| parent | dbd5acd2ba6bc9853f165d457eaf6abe7559a92e (diff) | |
| download | nova-a36e0a1cbc5645ab47041c2627dba80b39b23cc2.tar.gz nova-a36e0a1cbc5645ab47041c2627dba80b39b23cc2.tar.xz nova-a36e0a1cbc5645ab47041c2627dba80b39b23cc2.zip | |
Fixes for minor network manager issues centered around deleting/accessing instances which don't have network information set.
| -rw-r--r-- | nova/api/openstack/views/addresses.py | 1 | ||||
| -rw-r--r-- | nova/network/manager.py | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/nova/api/openstack/views/addresses.py b/nova/api/openstack/views/addresses.py index 8f07a2289..8d38bc9c3 100644 --- a/nova/api/openstack/views/addresses.py +++ b/nova/api/openstack/views/addresses.py @@ -88,7 +88,6 @@ class ViewBuilderV11(ViewBuilder): try: return interface['network']['label'] except (TypeError, KeyError) as exc: - LOG.exception(exc) raise TypeError def _extract_ipv4_addresses(self, interface): diff --git a/nova/network/manager.py b/nova/network/manager.py index e6b30d1a0..d7b0abdda 100644 --- a/nova/network/manager.py +++ b/nova/network/manager.py @@ -448,7 +448,7 @@ class NetworkManager(manager.SchedulerDependentManager): try: fixed_ips = kwargs.get('fixed_ips') or \ self.db.fixed_ip_get_by_instance(context, instance_id) - except exceptions.FixedIpNotFoundForInstance: + except exception.FixedIpNotFoundForInstance: fixed_ips = [] LOG.debug(_("network deallocation for instance |%s|"), instance_id, context=context) @@ -484,6 +484,9 @@ class NetworkManager(manager.SchedulerDependentManager): for vif in vifs: network = vif['network'] + if network is None: + continue + # determine which of the instance's IPs belong to this network network_IPs = [fixed_ip['address'] for fixed_ip in fixed_ips if fixed_ip['network_id'] == network['id']] |
