Comment 9 for bug 1839434

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to networking-ovn (stable/queens)

Reviewed: https://review.opendev.org/675607
Committed: https://git.openstack.org/cgit/openstack/networking-ovn/commit/?id=5b382bbfe75897697620b37ae5bc5de62fb087d6
Submitter: Zuul
Branch: stable/queens

commit 5b382bbfe75897697620b37ae5bc5de62fb087d6
Author: Maciej Józefczyk <email address hidden>
Date: Thu Aug 8 12:25:13 2019 +0000

    Do not modify passed by reference variables in mechanism_driver

    Test test_update_port_with_empty_data [0] from TestOVNMechanismDriverPortsV2
    class in neutron is runned agains:
    neutron.tests.unit.plugins.ml2.drivers.mechanism_test.TestMechanismDriver
    which in fact during update_port_postcommit() does nothing with
    the port, only validates it [1].

    In networking-ovn this test is runned against real mechanism driver:
    networking_ovn.ml2.mech_driver.OVNMechanismDriver. This ends with
    little difference - to port dict 'network' information is added
    during call of update_port_postcommit(). The port data itself
    remains the same.
    We shouldn't modify passed by reference variables there. So doing
    deepcopy on all provided data.

    Here comes also the question if this test inheritance is the
    right way.

    [0] https://review.opendev.org/#/c/673486
    [1] https://github.com/openstack/neutron/blob/master/neutron/tests/unit/plugins/ml2/drivers/mechanism_test.py#L208

    Closes-Bug: #1839434
    Change-Id: I1ad224960173fe896f6eb8049a188d9e82874068
    (cherry picked from commit b2b5e89bca25570a757c62fc6e30277365dae456)
    (cherry picked from commit 36bd132b409b82416cc49311099a8db7fbcbcda3)