summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2010-11-17 02:54:07 +0000
committerTarmac <>2010-11-17 02:54:07 +0000
commit551fd309fcbfedb99555a81fac6a40f003598fd6 (patch)
tree7748a677ddd3855308116c7225101ff5e58fc945 /nova/api
parent9c3fa8b6da2a5b81c989520afa9ca5fb5b90f063 (diff)
parentdb8c0a153df467c645df82b2ed6c2b282eae6850 (diff)
ec2_api commands for describe_addresses and associate_address are broken in trunk. This happened during the switch to ec2_id and internal_id. We clearly didn't have any unit tests for this, so I've added a couple in addition to the three line change to actually fix the bugs.
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/ec2/cloud.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index fbe4caa48..e2eaa7c5c 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -679,7 +679,7 @@ class CloudController(object):
context.project_id)
for floating_ip_ref in iterator:
address = floating_ip_ref['address']
- instance_id = None
+ ec2_id = None
if (floating_ip_ref['fixed_ip']
and floating_ip_ref['fixed_ip']['instance']):
internal_id = floating_ip_ref['fixed_ip']['instance']['ec2_id']
@@ -717,8 +717,8 @@ class CloudController(object):
"args": {"floating_address": floating_ip_ref['address']}})
return {'releaseResponse': ["Address released."]}
- def associate_address(self, context, ec2_id, public_ip, **kwargs):
- internal_id = ec2_id_to_internal_id(ec2_id)
+ def associate_address(self, context, instance_id, public_ip, **kwargs):
+ internal_id = ec2_id_to_internal_id(instance_id)
instance_ref = db.instance_get_by_internal_id(context, internal_id)
fixed_address = db.instance_get_fixed_address(context,
instance_ref['id'])