diff options
| author | Ilya Alekseyev <ialekseev@griddynamics.com> | 2011-06-25 02:42:27 +0400 |
|---|---|---|
| committer | Ilya Alekseyev <ialekseev@griddynamics.com> | 2011-06-25 02:42:27 +0400 |
| commit | a770864d308242bfcfa8dadb210595785d8fa71f (patch) | |
| tree | 9b4ffb8535a5a7faf0fbe4014481b829aa4f475a /nova/api | |
| parent | ff173245f0284f5f24cdfbe92704785a85dd1cb9 (diff) | |
tests
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/contrib/floating_ips.py | 14 |
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) |
