Comment 2 for bug 1568197

Revision history for this message
Adolfo Duarte (adolfo-duarte) wrote :

started a patch with tests which verify the correct values of the constants.
It does not solve the problem but it does provide a unittest to verify a fix.

https://review.openstack.org/#/c/303662/

This seems to be an import problem somewhere.

If you put an "import pdb, pdb.set_trace()" inside of common.neutron.constants, the correct values are assigned to the constants,
however the import is NOT happening a the line "from neutron.common import constant as l3_const" in neutron/db/l3_dvr_db.py L28. It is happening much earlier, but once L28 is reached in l3_dvr_db.py, the value of the constant is not correct any more.

As mentioned above, the problem can be seen by simply pulling the patch above (303662)

adding the following on l3_dvr_db.py before L28:
import pdb
pdb.set_trace()

And then running the tests with:
.../tests/unit/db$ py.test ./test_l3_hamode_db.py::L3HATestCase::test_verify_constant_router_interface_owners

and stepping through the code. You should see something like:
(Pdb) n
> /opt/neutron/neutron/db/l3_dvr_db.py(31)<module>()
-> from neutron.common import exceptions as n_exc
(Pdb) l3_const
<neutron.common._deprecate._DeprecateSubset object at 0x7fb28cffe790>
(Pdb) l3_const.ROUTER_INTERFACE_OWNERS
('network:router_interface', 'network:router_interface_distributed')
(Pdb)

NO ha_router_replicated_interface