Skip to content

Commit

Permalink
Handle instances being missing while listing floating IPs
Browse files Browse the repository at this point in the history
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
mikalstill authored and vishvananda committed Mar 31, 2012
1 parent 3842f2f commit 37dad35
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bin/nova-manage
Expand Up @@ -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,
Expand Down

0 comments on commit 37dad35

Please sign in to comment.