diff options
| author | Trey Morris <trey.morris@rackspace.com> | 2011-09-16 14:07:41 -0500 |
|---|---|---|
| committer | Trey Morris <trey.morris@rackspace.com> | 2011-09-30 15:39:02 -0500 |
| commit | 15b2a3b85b157e4a032d1fbb68bd3d7a509ed765 (patch) | |
| tree | 6a4fde9971a746d4903e0dbf3d1e9023a36ff93a /nova/api | |
| parent | 070e60d21776ea2b32ac557a0661d2025ef111d8 (diff) | |
| download | nova-15b2a3b85b157e4a032d1fbb68bd3d7a509ed765.tar.gz nova-15b2a3b85b157e4a032d1fbb68bd3d7a509ed765.tar.xz nova-15b2a3b85b157e4a032d1fbb68bd3d7a509ed765.zip | |
moved floating ip db access and sanity checking from network api into network manager
added floating ip get by fixed address
added fixed_ip_get
moved floating ip testing from osapi into the network tests where they
belong
Change-Id: I3ee53971206e37405a2adc2491412f7896e1af87
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/contrib/floating_ips.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/nova/api/openstack/contrib/floating_ips.py b/nova/api/openstack/contrib/floating_ips.py index 8b5b19c21..22d7d1a1d 100644 --- a/nova/api/openstack/contrib/floating_ips.py +++ b/nova/api/openstack/contrib/floating_ips.py @@ -80,8 +80,8 @@ class FloatingIPController(object): context = req.environ['nova.context'] try: - # FIXME(ja) - why does self.network_api.list_floating_ips raise? - floating_ips = self.network_api.list_floating_ips(context) + get_floating_ips = self.network_api.get_floating_ips_by_project + floating_ips = get_floating_ips(context) except exception.FloatingIpNotFoundForProject: floating_ips = [] @@ -92,7 +92,7 @@ class FloatingIPController(object): try: address = self.network_api.allocate_floating_ip(context) - ip = self.network_api.get_floating_ip_by_ip(context, address) + ip = self.network_api.get_floating_ip_by_address(context, address) except rpc.RemoteError as ex: # NOTE(tr3buchet) - why does this block exist? if ex.exc_type == 'NoMoreFloatingIps': @@ -162,7 +162,8 @@ class Floating_ips(extensions.ExtensionDescriptor): msg = _("Address not specified") raise webob.exc.HTTPBadRequest(explanation=msg) - floating_ip = self.network_api.get_floating_ip_by_ip(context, address) + floating_ip = self.network_api.get_floating_ip_by_address(context, + address) if floating_ip.get('fixed_ip'): try: self.network_api.disassociate_floating_ip(context, address) |
