]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
l3_db: not use L2 plugin _get_port unnecessarily
authorIsaku Yamahata <isaku.yamahata@intel.com>
Wed, 15 Jul 2015 19:34:12 +0000 (12:34 -0700)
committerIsaku Yamahata <isaku.yamahata@intel.com>
Fri, 14 Aug 2015 01:37:49 +0000 (18:37 -0700)
commit9ba23658a34eac696a7eed9a8aaca6a4625d1391
tree63cbad8f54412c06990402f783bd1801061783c3
parentc58441796736a763c910a7486646d1969ec1b98c
l3_db: not use L2 plugin _get_port unnecessarily

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

l3_db uses L2 plugin _get_port method unnecessarily instead of get_port.
It's dangerous because _get_port returns ORM db object which allows
the caller to update db rows directly. So the caller of _get_port may
update port db without notifying L2 plugin unintentionally.
In that case, L2 plugin or ML2 mechanism driver will be confused.
This patch replace _get_port with get_port method where possible.

Change-Id: I5a23f6cac5ea359645e6947fd69978f060c4ba97
Related-Bug: #1475093
neutron/db/l3_db.py
neutron/tests/unit/db/test_l3_dvr_db.py