]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Avoid performing extra query for fetching mac learning binding
authorSalvatore Orlando <salv.orlando@gmail.com>
Wed, 21 Aug 2013 12:14:54 +0000 (05:14 -0700)
committerSalvatore Orlando <salv.orlando@gmail.com>
Fri, 23 Aug 2013 16:06:23 +0000 (09:06 -0700)
commit417dd1727ba38966f53e83c69583650f2cf190fc
treed5285c775995fa713a00fb36a22fb2ff1f09f53a
parentd16e185d34df811bf858bf93cf056d0cb945e22d
Avoid performing extra query for fetching mac learning binding

Bug 1214879

Add a relationship performing eager load in the Port model, thus preventing
the 'extend' function from performing an extra query.
This patch also replaces assertTrue with assertEqual in unit tests as it
needs to evaluate whether the value of the mac_learning_enabled attribute
is equal to the boolean literal True, whereas assertTrue verifies that the
expression passed to it evaluates to True. This means that any value but
False will be enough for the test to pass, which is not correct.

Change-Id: I03345ef3a125fdfa1ec7f6c3363d76efc12ced82
neutron/plugins/nicira/NeutronPlugin.py
neutron/plugins/nicira/dbexts/maclearning.py
neutron/tests/unit/nicira/test_maclearning.py