Permalink
Browse files

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
  • Loading branch information...
1 parent 3842f2f commit 37dad352a17203102b4b9b828f84db9b75c57071 @mikalstill mikalstill committed with vishvananda Mar 26, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 bin/nova-manage
View
@@ -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,

0 comments on commit 37dad35

Please sign in to comment.