diff options
| author | Ilya Alekseyev <ilyaalekseyev@acm.org> | 2011-06-25 03:13:53 +0400 |
|---|---|---|
| committer | Ilya Alekseyev <ilyaalekseyev@acm.org> | 2011-06-25 03:13:53 +0400 |
| commit | da453fff9112a68ed81aebeb8f25305e91c3d426 (patch) | |
| tree | b3b95cf11018e8ee378a70d73d12393c5bab60fe /nova/api | |
| parent | 537117eb9e42f6d32f387485a76435c0485c3d6e (diff) | |
| parent | 5e4d90b33ddb993294232eea168a768486ba0bf4 (diff) | |
merged
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/contrib/floating_ips.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/nova/api/openstack/contrib/floating_ips.py b/nova/api/openstack/contrib/floating_ips.py index 95502a5c5..467b46712 100644 --- a/nova/api/openstack/contrib/floating_ips.py +++ b/nova/api/openstack/contrib/floating_ips.py @@ -91,7 +91,7 @@ class FloatingIPController(object): raise return {'allocated': { - "id" : ip['id'], + "id": ip['id'], "floating_ip": ip['address']}} def delete(self, req, id): @@ -126,15 +126,17 @@ class FloatingIPController(object): 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) + floating_ip = self.network_api.get(context, id) + address = floating_ip['address'] + fixed_ip = floating_ip['fixed_ip']['address'] try: - self.network_api.disassociate_floating_ip(context, floating_ip) + self.network_api.disassociate_floating_ip(context, address) except rpc.RemoteError: raise - return {'disassociated': floating_ip} + return {'disassociated': {'floating_ip': address, + 'fixed_ip': fixed_ip}} def _get_ip_by_id(self, context, value): """Checks that value is id and then returns its address.""" |
