summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-04-01 02:32:15 +0000
committerGerrit Code Review <review@openstack.org>2012-04-01 02:32:15 +0000
commit5a0ebb687eeebd6c4262c10243a9019cbf31d3de (patch)
tree68d1a0a79c94de2b9d12e1b49b2c22da22ef04d1
parent3c925ba26c44f167a5f1a4c1981fe37fc8ff4be1 (diff)
parent8d2a755552d216821f656a01f3ec1cd32cb6a286 (diff)
downloadnova-5a0ebb687eeebd6c4262c10243a9019cbf31d3de.tar.gz
Merge "Handle instances being missing while listing floating IPs" into milestone-proposed
-rwxr-xr-xbin/nova-manage9
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/nova-manage b/bin/nova-manage
index 65082ba90a..6e8f7fd39b 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,