Fixes nova-manage bug. When a nova-network host has allocated floating ips *AND* some associated, the nova-manage floating list <host> would throw exception because was expecting hash with 'ec2_id' key , however, the obj returned is a sqlalchemy obj and the attr we need is 'hostname'.

This commit is contained in:
John Tran 2011-06-01 23:26:18 +00:00 committed by Tarmac
commit 78093e8101

View File

@ -536,7 +536,7 @@ class FloatingIpCommands(object):
for floating_ip in floating_ips:
instance = None
if floating_ip['fixed_ip']:
instance = floating_ip['fixed_ip']['instance']['ec2_id']
instance = floating_ip['fixed_ip']['instance']['hostname']
print "%s\t%s\t%s" % (floating_ip['host'],
floating_ip['address'],
instance)