]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Move the assignment of existing_floating_ips before try block
authorYalei Wang <yalei.wang@intel.com>
Wed, 21 Jan 2015 09:48:56 +0000 (17:48 +0800)
committerBrian Haley <brian.haley@hp.com>
Tue, 24 Feb 2015 21:55:58 +0000 (16:55 -0500)
commitb117e8ec854dd0a26d04beb7e1effedffec3cb3a
tree9bee1182c5476070af73851126fc0180c54dbf3e
parentad67e2513f219c4e3db10d29fb688f32c1fcdfdb
Move the assignment of existing_floating_ips before try block

In function _process_external() in agent/l3/agent.py, the call to
iptables_manager.defer_apply() may throw an exception, making a
later call to _update_fip_statuses() use an un-initialized value.
This will throw its own UnboundLocalError, with the result being
no iptables rules will be applied.

Added tests to cover both the defer_apply() code exception
processing, as well as this new case where we might jump to
_update_fip_statuses() without having done any work on floating
IP addresses.

Change-Id: I0045effc9319772127758be4aacca02ab5c236cd
Closes-Bug: #1413111
neutron/agent/l3/agent.py
neutron/agent/linux/iptables_manager.py
neutron/tests/unit/test_iptables_manager.py
neutron/tests/unit/test_l3_agent.py