Skip to content

Commit

Permalink
Fixes bug 862658 -- ec2 metadata issue getting IPs
Browse files Browse the repository at this point in the history
Was looping through a tuple of (ipv4s, ipv6s) vs just ipv4s list.. to get floating IPs.

Change-Id: Ie743012b7074ecb8b9bc6f018968e21e2f6d405d
  • Loading branch information
comstud committed Sep 29, 2011
1 parent 070e60d commit eff0a63
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nova/api/ec2/cloud.py
Expand Up @@ -271,7 +271,8 @@ def _get_floaters_for_instance(self, context, instance, return_all=True):
"""Return all floating IPs for an instance"""

ret_floaters = []
fixed_ips = self._get_fixed_ips_for_instance(context, instance)
# only loop through ipv4 addresses
fixed_ips = self._get_fixed_ips_for_instance(context, instance)[0]
for ip in fixed_ips:
floaters = self._get_floaters_for_fixed_ip(context, ip)
# Allows a short circuit if we just need any floater.
Expand All @@ -287,6 +288,7 @@ def _get_mpi_data(self, context, project_id):
search_opts = {'project_id': project_id}
for instance in self.compute_api.get_all(context,
search_opts=search_opts):
# only look at ipv4 addresses
fixed_ips = self._get_fixed_ips_for_instance(context, instance)[0]
if fixed_ips:
line = '%s slots=%d' % (fixed_ips[0], instance['vcpus'])
Expand Down

0 comments on commit eff0a63

Please sign in to comment.