]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix KeyError except on router_info in FW Agent
authorSridar Kandaswamy <skandasw@cisco.com>
Mon, 10 Mar 2014 06:31:28 +0000 (23:31 -0700)
committerSridar Kandaswamy <skandasw@cisco.com>
Fri, 14 Mar 2014 20:26:53 +0000 (13:26 -0700)
commit931d5f9fd1ae0cb490362f16214183aa7d748514
tree57c0715aa8271e79c5866a8dcfd94dbe57b4bf98
parenta3e7e260544b43344f0a268b5257ee743e1034ca
Fix KeyError except on router_info in FW Agent

The workflow of creating a firewall when a router without any i/f is present in that tenant
causes a KeyError on the FWAgent. The issue occurs as such routers are present in the list of
routers returned by get_routers() but are not populated in the router_info dict. Adding a check
before accessing the dict to prevent the exception. When an i/f is added to such routers -
_router_added processing in the l3agent will populate the router_info dict and the FWAgent
also picks this up in that context.

Change-Id: I5ea22e88a46e62372a0462e9cb958a08dd9f4c7d
Closes-Bug: #1289643
neutron/services/firewall/agents/l3reference/firewall_l3_agent.py
neutron/tests/unit/services/firewall/agents/l3reference/test_firewall_l3_agent.py