diff options
| author | Eldar Nugaev <reldan@oscloud.ru> | 2011-06-25 03:05:09 +0400 |
|---|---|---|
| committer | Eldar Nugaev <reldan@oscloud.ru> | 2011-06-25 03:05:09 +0400 |
| commit | 5e4d90b33ddb993294232eea168a768486ba0bf4 (patch) | |
| tree | 779fa6ddbf949a7b322919c0102c4e7691aa7771 /nova/api | |
| parent | 62018b1abaa007f8f530ba08d74413c59e2814cb (diff) | |
added disassociate method to tests
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.""" |
