Merge lp:~jtran/nova/lp758975 into lp:~hudson-openstack/nova/trunk

Proposed by John Tran
Status: Merged
Approved by: Mark Washenberger
Approved revision: 1115
Merged at revision: 1137
Proposed branch: lp:~jtran/nova/lp758975
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 12 lines (+1/-1)
1 file modified
bin/nova-manage (+1/-1)
To merge this branch: bzr merge lp:~jtran/nova/lp758975
Reviewer Review Type Date Requested Status
Mark Washenberger (community) Approve
Ed Leafe (community) Approve
Devin Carlen (community) Approve
Review via email: mp+62529@code.launchpad.net

Description of the change

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'.

To post a comment you must log in.
Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm but seems wrong to be dealing with sqlalchemy objects at this layer...

review: Approve
Revision history for this message
Ed Leafe (ed-leafe) wrote :

Agree with Devin's comment, but fixing a bug is fixing a bug, not fixing a design...

review: Approve
Revision history for this message
Mark Washenberger (markwash) wrote :

This fixes the problem for me as well. But so would using ['hostname'] which seems so much more consistent. I know its just a style thing but can you fix that?

Thanks.

review: Needs Fixing
lp:~jtran/nova/lp758975 updated
1115. By John Tran

fixed as per peer review to make more consistent

Revision history for this message
John Tran (jtran) wrote :

> This fixes the problem for me as well. But so would using ['hostname'] which
> seems so much more consistent. I know its just a style thing but can you fix
> that?
>
> Thanks.

Done.

Revision history for this message
Mark Washenberger (markwash) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/nova-manage'
2--- bin/nova-manage 2011-05-25 20:58:40 +0000
3+++ bin/nova-manage 2011-06-01 23:02:30 +0000
4@@ -536,7 +536,7 @@
5 for floating_ip in floating_ips:
6 instance = None
7 if floating_ip['fixed_ip']:
8- instance = floating_ip['fixed_ip']['instance']['ec2_id']
9+ instance = floating_ip['fixed_ip']['instance']['hostname']
10 print "%s\t%s\t%s" % (floating_ip['host'],
11 floating_ip['address'],
12 instance)