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
This commit is contained in:

committed by
Vishvananda Ishaya

parent
3842f2f7bd
commit
37dad352a1
@@ -680,8 +680,13 @@ class FloatingIpCommands(object):
|
|||||||
instance_id = None
|
instance_id = None
|
||||||
if floating_ip['fixed_ip_id']:
|
if floating_ip['fixed_ip_id']:
|
||||||
fixed_ip = db.fixed_ip_get(ctxt, 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'])
|
try:
|
||||||
instance_id = instance.get('uuid', "none")
|
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'],
|
print "%s\t%s\t%s\t%s\t%s" % (floating_ip['project_id'],
|
||||||
floating_ip['address'],
|
floating_ip['address'],
|
||||||
instance_id,
|
instance_id,
|
||||||
|
Reference in New Issue
Block a user