neutron/neutron
Eugene Nikanorov 0109578a8e Fix incorrect query for user ip allocations
Previously the query was fetching an IPAllocation object incorrectly
relying on the fact that it has port attribute that should be
join-loaded when it really is not.

Incorrect query produced by previous code:
SELECT ipallocations.port_id AS ipallocations_port_id,
       ipallocations.ip_address AS ipallocations_ip_address,
       ipallocations.subnet_id AS ipallocations_subnet_id,
       ipallocations.network_id AS ipallocations_network_id
FROM ipallocations, ports
WHERE ipallocations.subnet_id = :subnet_id_1
      AND ports.device_owner NOT IN (:device_owner_1)

The query then may have produced results that don't satisfy
the condition intended by the code.

Query produced by the fixed code:
SELECT ipallocations.port_id AS ipallocations_port_id,
       ipallocations.ip_address AS ipallocations_ip_address,
       ipallocations.subnet_id AS ipallocations_subnet_id,
       ipallocations.network_id AS ipallocations_network_id
FROM ipallocations JOIN ports ON ports.id = ipallocations.port_id
WHERE ipallocations.subnet_id = :subnet_id_1
      AND ports.device_owner NOT IN (:device_owner_1)

Change-Id: I34682df784e30e3ce49ee48c690f8b799ad58149
Closes-Bug: #1357055
2015-04-22 15:35:45 +04:00
..
agent Merge "Only call get_engine().pool.dispose if _FACADE" 2015-04-21 16:43:54 +00:00
api Replace custom method call logger with oslo.log helper 2015-04-20 15:16:54 +00:00
callbacks Migrate to oslo.log 2015-03-12 11:22:56 +01:00
cmd Add simple ARP spoofing protection 2015-03-29 20:57:07 -07:00
common Replace custom method call logger with oslo.log helper 2015-04-20 15:16:54 +00:00
db Fix incorrect query for user ip allocations 2015-04-22 15:35:45 +04:00
debug Migrate to oslo.log 2015-03-12 11:22:56 +01:00
extensions Moving VLAN Transparency support from core to extension 2015-04-08 08:35:13 -07:00
hacking Migrate to oslo.log 2015-03-12 11:22:56 +01:00
ipam Simple subnetpool allocation quotas 2015-03-31 20:56:31 +00:00
locale Imported Translations from Transifex 2015-04-16 06:13:44 +00:00
notifiers Reuse nova batch notifier 2015-03-20 13:55:08 +00:00
openstack Merge "Synced versionutils from oslo-incubator" 2015-04-16 19:49:00 +00:00
plugins Merge "Replace custom method call logger with oslo.log helper" 2015-04-20 20:21:22 +00:00
scheduler OOP cleanup: start protected method names with underscore 2015-04-08 00:24:43 +04:00
server Migrate to oslo.log 2015-03-12 11:22:56 +01:00
services Replace custom method call logger with oslo.log helper 2015-04-20 15:16:54 +00:00
tests Fix incorrect query for user ip allocations 2015-04-22 15:35:45 +04:00
__init__.py Revert "monkey patch stdlib before importing other modules" 2015-02-11 17:26:33 -08:00
auth.py Migrate to oslo.log 2015-03-12 11:22:56 +01:00
context.py context: reuse base oslo.context class for to_dict() 2015-04-10 18:14:53 +02:00
hooks.py Remove the useless vim modelines 2014-06-21 15:07:31 +08:00
i18n.py oslo: migrate to namespace-less import paths 2015-02-05 15:09:32 +01:00
manager.py Migrate to oslo.log 2015-03-12 11:22:56 +01:00
neutron_plugin_base_v2.py Basic subnetpool CRUD 2015-03-18 22:53:50 -07:00
policy.py Merge "Enable to apply policies to resources with special plural" 2015-04-01 08:04:45 +00:00
quota.py Treat all negative quota values as -1 2015-04-02 17:26:51 +05:30
service.py Only call get_engine().pool.dispose if _FACADE 2015-03-30 09:58:09 -07:00
version.py Remove the useless vim modelines 2014-06-21 15:07:31 +08:00
wsgi.py Only call get_engine().pool.dispose if _FACADE 2015-03-30 09:58:09 -07:00