Merge lp:~itohm/nova/lp746922 into lp:~hudson-openstack/nova/trunk

Proposed by Masanori Itoh
Status: Merged
Approved by: Devin Carlen
Approved revision: 932
Merged at revision: 932
Proposed branch: lp:~itohm/nova/lp746922
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 12 lines (+2/-0)
1 file modified
nova/api/ec2/cloud.py (+2/-0)
To merge this branch: bzr merge lp:~itohm/nova/lp746922
Reviewer Review Type Date Requested Status
Devin Carlen (community) Approve
Vish Ishaya (community) Approve
Review via email: mp+55976@code.launchpad.net

Description of the change

Add checking if the floating_ip is allocated or not before appending to result array in DescribeAddresses.

To post a comment you must log in.
Revision history for this message
Vish Ishaya (vishvananda) wrote :

I don't see this as a huge issue, but since we can view all unallocated addresses with nova-manage floating list, I'm ok with this change.

review: Approve
Revision history for this message
Devin Carlen (devcamcar) wrote :

Good fix!

review: Approve
Revision history for this message
Masanori Itoh (itohm) wrote :

Hello Vish,

The reason why I want to change the current behavior is that there are several useful tools depending on DescribeAddresses to see which Elasic IPs are available for associating them to instances.
I hope the above makes sense.

Regards,
Masanori

Revision history for this message
Devin Carlen (devcamcar) wrote :

This appears to only change the behavior if you are using the admin account though.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/api/ec2/cloud.py'
2--- nova/api/ec2/cloud.py 2011-03-30 05:59:13 +0000
3+++ nova/api/ec2/cloud.py 2011-04-01 17:14:42 +0000
4@@ -757,6 +757,8 @@
5 iterator = db.floating_ip_get_all_by_project(context,
6 context.project_id)
7 for floating_ip_ref in iterator:
8+ if floating_ip_ref['project_id'] is None:
9+ continue
10 address = floating_ip_ref['address']
11 ec2_id = None
12 if (floating_ip_ref['fixed_ip']