From 6e3c492ae878335ea7ef7e00cc9e9abc55b0a0b4 Mon Sep 17 00:00:00 2001 From: Ryu Ishimoto Date: Fri, 22 Jul 2011 05:23:44 +0900 Subject: Catch the FixedIpNotFoundForInstance exception when no fixed IP is mapped to instance --- nova/network/manager.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) -- cgit