From 40126fdb920710e2ffbc481bbe9ddf6d0e047af3 Mon Sep 17 00:00:00 2001 From: JordanP Date: Wed, 12 Jun 2013 16:57:38 +0200 Subject: Quantum API _get_floating_ip_by_address mismatch with Nova-Net _get_floating_ip_by_address() has a unspecified behavior when IP address is empty and only one floating IP is allocated in the pool. It should return a 404 Not found like Nova-Net does but instead returns the only IP in the pool. Fix bug #1190242 Change-Id: Id4843edda8e66ccabab5e9d053c595a1cd247770 --- nova/network/quantumv2/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nova/network/quantumv2/api.py b/nova/network/quantumv2/api.py index 3721d53b1..054611cd3 100644 --- a/nova/network/quantumv2/api.py +++ b/nova/network/quantumv2/api.py @@ -706,6 +706,8 @@ class API(base.Base): def _get_floating_ip_by_address(self, client, address): """Get floatingip from floating ip address.""" + if not address: + raise exception.FloatingIpNotFoundForAddress(address=address) data = client.list_floatingips(floating_ip_address=address) fips = data['floatingips'] if len(fips) == 0: -- cgit