]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
l3: not use L2 plugin _get_subnet unnecessarily
authorIsaku Yamahata <isaku.yamahata@intel.com>
Thu, 16 Jul 2015 02:27:16 +0000 (19:27 -0700)
committerIsaku Yamahata <isaku.yamahata@intel.com>
Fri, 14 Aug 2015 01:37:49 +0000 (18:37 -0700)
commitff709d5b83abdc954311be9e7d52dfa9e9c3d7ba
tree813cf8add9430f20d7e5c0c0f826aaa4ccd3dba1
parent9ba23658a34eac696a7eed9a8aaca6a4625d1391
l3: not use L2 plugin _get_subnet unnecessarily

This patch is clean up to prevent future breakage by eliminating
potentially dangerous code.

l3_db and related code use L2 plugin _get_subnet and related method
unnecessarily instead of get_subnet.
It's dangerous because _get_subnet returns ORM db object which allows
the caller to update db rows directly. So the caller of _get_subnet
may update subnet db without notifying L2 plugin unintentionally.
In that case, L2 plugin or ML2 mechanism driver will be confused.
This patch replaces _get_subnet and _get_subnets_by_network with
get_subnet, get_subnets_by_network where possible.

Change-Id: I85769e639a408a292b5bd70a9d9a1ac292e2b51c
Related-Bug: #1475093
neutron/db/db_base_plugin_v2.py
neutron/db/extraroute_db.py
neutron/db/l3_db.py