summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyu Ishimoto <ryu@midokura.jp>2011-07-22 05:23:44 +0900
committerRyu Ishimoto <ryu@midokura.jp>2011-07-22 05:23:44 +0900
commit6e3c492ae878335ea7ef7e00cc9e9abc55b0a0b4 (patch)
tree02da9d8efbba72b7bb9ec25cd4ad861e88a293b8
parent87403c1e8b27b52e9e84856490ea7a0dc51f5bb6 (diff)
Catch the FixedIpNotFoundForInstance exception when no fixed IP is mapped to instance
-rw-r--r--nova/network/manager.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/nova/network/manager.py b/nova/network/manager.py
index ef96d48a7..83d0519c9 100644
--- a/nova/network/manager.py
+++ b/nova/network/manager.py
@@ -427,7 +427,12 @@ class NetworkManager(manager.SchedulerDependentManager):
and info = dict containing pertinent networking data
"""
# TODO(tr3buchet) should handle floating IPs as well?
- fixed_ips = self.db.fixed_ip_get_by_instance(context, instance_id)
+ try:
+ fixed_ips = self.db.fixed_ip_get_by_instance(context, instance_id)
+ except exception.FixedIpNotFoundForInstance, ex:
+ LOG.warn(_('No fixed IPs for instance %s'), instance_id)
+ fixed_ips = []
+
vifs = self.db.virtual_interface_get_by_instance(context, instance_id)
flavor = self.db.instance_type_get_by_id(context,
instance_type_id)