diff options
| author | Dan Prince <dprince@redhat.com> | 2012-03-12 23:52:40 -0400 |
|---|---|---|
| committer | Dan Prince <dprince@redhat.com> | 2012-03-12 23:52:40 -0400 |
| commit | da23487487d442cffeb252236428abbda3f45746 (patch) | |
| tree | 713797f8feb69a4fbe55e05588b7523d710d3509 | |
| parent | fd80f1b2e1dc03b77fa51cfa27dedce1c593201d (diff) | |
| download | nova-da23487487d442cffeb252236428abbda3f45746.tar.gz nova-da23487487d442cffeb252236428abbda3f45746.tar.xz nova-da23487487d442cffeb252236428abbda3f45746.zip | |
fixed list warn when ip allocated to missing inst.
Update 'nova-manage fixed list' so it prints a warning if an IP
is allocated to a deleted/missing instance.
Fixes LP Bug #953685.
Change-Id: I72b7ad2cb01e31cf9bb6cab904ab10d8769a3526
| -rwxr-xr-x | bin/nova-manage | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/nova-manage b/bin/nova-manage index cf296b537..57bb31ae4 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -584,9 +584,13 @@ class FixedIpCommands(object): network = db.network_get(context.get_admin_context(), fixed_ip['network_id']) if fixed_ip['instance_id']: - instance = instances_by_id[fixed_ip['instance_id']] - hostname = instance['hostname'] - host = instance['host'] + instance = instances_by_id.get(fixed_ip['instance_id']) + if instance: + hostname = instance['hostname'] + host = instance['host'] + else: + print 'WARNING: fixed ip %s allocated to missing' \ + ' instance' % str(fixed_ip['address']) print "%-18s\t%-15s\t%-15s\t%s" % ( network['cidr'], fixed_ip['address'], |
