]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Skip bindings with agent_id=None
authorAnn Kamyshnikova <akamyshnikova@mirantis.com>
Wed, 21 Oct 2015 14:37:34 +0000 (17:37 +0300)
committerAnn Kamyshnikova <akamyshnikova@mirantis.com>
Sat, 14 Nov 2015 06:23:55 +0000 (06:23 +0000)
commit0b8f9d0948cdb429c4b67ba138640ae515ffa1b2
tree14143cebb866f2ff8d61a8d2c5afbc02f8dc01fe
parenteccb3d3f872ce2833cb76253653f2cf27857a0ed
Skip bindings with agent_id=None

To avoid having extra L3HARouterAgentPortBinding with l3_agent as None,
operation of setting l3_agent should be atomic.
For this purpose, transaction was added in methods
create_ha_port_and_bind and _bind_ha_router_to_agents in change
Iaad82fe522cfd70061daecf411c924fdc11b7e41

In case if router was just created and l3 agent was not scheduled yet,
so l3_agent_id is None, l3-agent-list-hosting-router <router> will fail.
This change makes it work by skipping binding with agent_id=None.

Partial-bug: #1499647

Change-Id: I1aaf4b651f738febc26b0e1105aeabe066bca2a0
neutron/db/l3_hamode_db.py
neutron/tests/unit/db/test_l3_hamode_db.py