From 37dad352a17203102b4b9b828f84db9b75c57071 Mon Sep 17 00:00:00 2001 From: Michael Still Date: Mon, 26 Mar 2012 14:37:48 +1100 Subject: [PATCH] Handle instances being missing while listing floating IPs This resolves bug 964950, which is a nova-manage crash while listing floating IPs when an instance has gone missing. Change-Id: Ib628356608bc0cbb9089029876ab1df7e9f02531 --- bin/nova-manage | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index 462b9d5e2101..c0009bc243a6 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -680,8 +680,13 @@ class FloatingIpCommands(object): instance_id = None if floating_ip['fixed_ip_id']: fixed_ip = db.fixed_ip_get(ctxt, floating_ip['fixed_ip_id']) - instance = db.instance_get(ctxt, fixed_ip['instance_id']) - instance_id = instance.get('uuid', "none") + try: + instance = db.instance_get(ctxt, fixed_ip['instance_id']) + instance_id = instance.get('uuid', "none") + except exception.InstanceNotFound: + msg = _('Missing instance %s') + instance_id = msg % fixed_ip['instance_id'] + print "%s\t%s\t%s\t%s\t%s" % (floating_ip['project_id'], floating_ip['address'], instance_id,