]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Reuse caller's session in ML2 DB methods
authorDane LeBlanc <leblancd@cisco.com>
Tue, 14 Apr 2015 13:18:18 +0000 (09:18 -0400)
committerDane LeBlanc <leblancd@cisco.com>
Thu, 7 May 2015 21:26:25 +0000 (17:26 -0400)
commit47dd65cf986d712e9c6ca5dcf4420dfc44900b66
tree5a9ab03b4f5823255a6db2e04ab8197b5bf14b3d
parent94f3a14f54a154f45a3451dac71a8f8dcbfa329e
Reuse caller's session in ML2 DB methods

This patch changes the get_port_from_device_mac() and
get_sg_ids_grouped_by_port() methods in ML2 db.py module so that
they do not create a new database session (via get_session()), but
instead reuse the session associated with the caller's context.

In order to make the session that is associated with the caller's
context available to these ML2 DB methods, the
get_ports_from_devices plugin API in securitygroups_rps_base.py
needs to be modified so that the context can be passed down to the
ML2 plugin. (A similar change is made to the get_port_from_device
plugin API for consistency.)

Change-Id: I3f990895887e156de929bd7ac3732df114dd4a4b
Closes-Bug: 1441205
12 files changed:
neutron/api/rpc/handlers/securitygroups_rpc.py
neutron/db/securitygroups_rpc_base.py
neutron/plugins/ml2/db.py
neutron/plugins/ml2/plugin.py
neutron/plugins/ml2/rpc.py
neutron/plugins/oneconvergence/plugin.py
neutron/tests/unit/agent/test_securitygroups_rpc.py
neutron/tests/unit/plugins/ml2/test_db.py
neutron/tests/unit/plugins/ml2/test_plugin.py
neutron/tests/unit/plugins/ml2/test_rpc.py
neutron/tests/unit/plugins/ml2/test_security_group.py
neutron/tests/unit/plugins/oneconvergence/test_security_group.py