]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Forbid update of subnet gateway ip when in use by a port
authorSalvatore Orlando <salv.orlando@gmail.com>
Thu, 8 Aug 2013 17:38:11 +0000 (10:38 -0700)
committerSalvatore Orlando <salv.orlando@gmail.com>
Wed, 28 Aug 2013 21:34:17 +0000 (14:34 -0700)
commit274481bf30150f3900e0a860ca7321cdd682850e
treeffee411cbb63f237c182c62fc90919e2bf546cf8
parenta34f6f0e868bcd0a22dca4c0879247791c997434
Forbid update of subnet gateway ip when in use by a port

Bug 1186322

If a port is currently using the subnet's gateway IP, which usually
happens for router interfaces, do not allow updates to the gateway IP.
This patch adds an extra query on the IPAllocation model, which
returns at most a single record, and is executed in _validate_subnet
only when the subnet is updated.

Change-Id: Ie29be1b83f9a639562bfc84f3f2c082833126d32
neutron/common/exceptions.py
neutron/db/db_base_plugin_v2.py
neutron/tests/unit/test_db_plugin.py