Comment 2 for bug 1633334

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-midonet (master)

Reviewed: https://review.openstack.org/386396
Committed: https://git.openstack.org/cgit/openstack/networking-midonet/commit/?id=d2d7024850f9e49031b323bb5173c3f04c8f496a
Submitter: Jenkins
Branch: master

commit d2d7024850f9e49031b323bb5173c3f04c8f496a
Author: YAMAMOTO Takashi <email address hidden>
Date: Fri Oct 14 13:20:21 2016 +0900

    Retrive DB object after update

    Revision numbers are bumped in the db flush callback.
    It doesn't work well for us because we have surrounding transactions,
    which would defer object flushing.

    This commit workarounds the issue by retrieving DB objects again.

    An alternative would be to make the base class methods provide
    DB object for us, similarly to what create methods do.

    I don't quite understand why expire_all() is necessary, but without
    having them in update_port, get_port() sometimes (not always) see
    the previous values of attributes and it makes some tests including
    the following ones fail occasionally.

        neutron.tests.tempest.api.test_extension_driver_port_security.PortSecTest.test_port_sec_update_pass
        neutron.tests.tempest.api.test_extension_driver_port_security.PortSecTest.test_port_sec_update_port_failed

    Closes-Bug: #1633334
    Change-Id: I370a2e5e987c177c540f1a0241212de62da1d930