Comment 9 for bug 1669528

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/newton)

Reviewed: https://review.openstack.org/470297
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=cb773098d276cfbabc600361e91cb709ec846ba8
Submitter: Jenkins
Branch: stable/newton

commit cb773098d276cfbabc600361e91cb709ec846ba8
Author: Kevin Benton <email address hidden>
Date: Fri Mar 3 08:51:33 2017 -0800

    deepcopy binding and binding levels avoid expiration

    Perform a deepcopy on the sqla objects passed into the PortContext
    so we get detached versions of them safe to reference forever.
    This is necessary because the PortContexts outlive the
    transaction context managers they are creating in which means an
    object can be expired and result in a query after a commit
    (e.g. in bind_port_if_needed) that will fail and result in an
    exception.

    This required a few additional explicit session.merge calls to deal
    with cases where touching the mech context was implicitly expected
    to modify the DB state on the next commit.

    Conflicts:
     neutron/plugins/ml2/driver_context.py
     neutron/plugins/ml2/plugin.py
     neutron/tests/unit/plugins/ml2/test_port_binding.py

    Closes-Bug: #1669528
    Change-Id: Ib5ba2daa80acba53c082bade1f61a3ee44ca41fc
    (cherry picked from commit 20c1de9dc83875431e8bf995f3f4f85bd6d81955)