]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix for KeyError: 'gw_port_host' on l3_agent
authorMichael Smith <michael.smith6@hp.com>
Tue, 2 Dec 2014 22:22:04 +0000 (14:22 -0800)
committerMichael Smith <michael.smith6@hp.com>
Thu, 11 Dec 2014 21:06:47 +0000 (13:06 -0800)
commit5908a60ab98886a807044da56f51bceafd15edc9
tree7a08584608ee0c0f602505d130031695b79b3292
parentdaf7de66c4d81c76c83a75c84bc3e0e735c4c404
Fix for KeyError: 'gw_port_host' on l3_agent

The dictionary field 'gw_port_host' was added for
DVR routers and is used by the scheduler and l3_agent
to schedule where the SNAT port for a DVR router
will be hosted.  In some code flows on the l3_agent,
this field is checked to determine what the agent
should do if the host matches its own or not.

Recently it has been seen that the router data sent
from the scheduler is missing this field in some cases.
This causes the agent to throw a KeyError and not function
properly.  This patch will make the l3_agent more robust
and less fragile by calling 'get' instead of assuming the
field will be there.

More work may be needed on the scheduler side to see why
this field is missing. That is why I am marking this as a
partial-fix for now. But this patch will make the l3_agent
less prone to errors and therefore an improvement.

Change-Id: Ib26ccfa7b945cb4e8f2ec4adc5e6ae91cbaae02e
Partial-Bug: #1394043
neutron/agent/l3/agent.py