]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix l2pop regression
authorAssaf Muller <amuller@redhat.com>
Tue, 20 Oct 2015 21:42:57 +0000 (17:42 -0400)
committerAssaf Muller <amuller@redhat.com>
Wed, 21 Oct 2015 13:53:06 +0000 (09:53 -0400)
commit204eb2af1752cbdd4d1bfc42aa4d61debdeb7551
treeb3d78ad26faa3381c50027d866019d081875a32f
parent9cb6ece7c9f4bdf1dacdc5e39a5d51ad975d3478
Fix l2pop regression

Patch https://review.openstack.org/#/c/236970/ introduced an issue
where get_agent_by_host can return a random host (Including L3,
DHCP or metadata agents), not only L2 agents. The caller then
tries to get tunneling_ip, which might not exist on the returned
agent, causing l2pop code to bail out with a WARNING:
'Unable to retrieve the agent ip...'.

The issue was found by manual introspection of the code, and
verified by modifying the l2pop fullstack test to register L3
agents. Both a unit test was added, as well as modifying the
fullstack connectivity test to register L3 agents if l2pop
is enabled.

The code will now check for agents with a tunneling_ip key
in their configurations dict, which is required for l2pop
to work correctly, essentially a form of duck typing.

Change-Id: Ib3072966140b7f6ca954d7847ad9835aa1191998
Closes-Bug: #1508205
neutron/plugins/ml2/drivers/l2pop/db.py
neutron/tests/fullstack/test_connectivity.py
neutron/tests/unit/plugins/ml2/drivers/l2pop/test_db.py [new file with mode: 0644]