summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorIlya Alekseyev <ialekseev@griddynamics.com>2011-06-25 02:42:27 +0400
committerIlya Alekseyev <ialekseev@griddynamics.com>2011-06-25 02:42:27 +0400
commita770864d308242bfcfa8dadb210595785d8fa71f (patch)
tree9b4ffb8535a5a7faf0fbe4014481b829aa4f475a /nova/api
parentff173245f0284f5f24cdfbe92704785a85dd1cb9 (diff)
tests
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/contrib/floating_ips.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/nova/api/openstack/contrib/floating_ips.py b/nova/api/openstack/contrib/floating_ips.py
index c6bc85c61..95502a5c5 100644
--- a/nova/api/openstack/contrib/floating_ips.py
+++ b/nova/api/openstack/contrib/floating_ips.py
@@ -104,10 +104,10 @@ class FloatingIPController(object):
"id": ip['id'],
"floating_ip": ip['address']}}
- def associate(self, req, id_ip, body):
+ def associate(self, req, id, body):
""" /floating_ips/{id}/associate fixed ip in body """
context = req.environ['nova.context']
- floating_ip = self._get_ip_by_id(context, id_ip)
+ floating_ip = self._get_ip_by_id(context, id)
fixed_ip = body['associate_address']['fixed_ip']
@@ -117,13 +117,17 @@ class FloatingIPController(object):
except rpc.RemoteError:
raise
- return {'associated': [floating_ip, fixed_ip]}
+ return {'associated':
+ {
+ "floating_ip_id": id,
+ "floating_ip": floating_ip,
+ "fixed_ip": fixed_ip}}
- def disassociate(self, req, id_ip, body):
+ def disassociate(self, req, id, body):
""" POST /floating_ips/{id}/disassociate """
context = req.environ['nova.context']
- floating_ip = self._get_ip_by_id(context, id_ip)
+ floating_ip = self._get_ip_by_id(context, id)
try:
self.network_api.disassociate_floating_ip(context, floating_ip)