]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
get_device_by_ip: don't fail if device was deleted
authorJohn Schwarz <jschwarz@redhat.com>
Thu, 15 Oct 2015 14:34:01 +0000 (17:34 +0300)
committerJohn Schwarz <jschwarz@redhat.com>
Thu, 22 Oct 2015 16:27:10 +0000 (19:27 +0300)
commitf3dece785e591ea68ed5bbecbbfa4ac3a29fbc8f
tree0eef4f5c0328301d1ed1ef6b3957e1e027a5d73f
parent9da4dfae56f22414e389bff560a9ee10991e1d7d
get_device_by_ip: don't fail if device was deleted

The function gets a list of all the devices that exists on the machine,
and then iterates on them one at a time in order to find the correct
device which holds the ip specified. However, if one of the devices was
in the mean time deleted, the code will raise an Exception. In the ovs
agent's case, this will cause it to not run at all (requiring a
restart).

Also, changes to a few tests of LinuxBridge were made because
linuxbridge doesn't check that cfg.CONF.VXLAN.local_ip is not empty
before using it (a bug, surely). Since it's out of scope of this patch
to fix this, workarounds were implemented to make sure the tests ignore
the option instead.

Closes-Bug: #1506503
Change-Id: Iad285d7c763b0e8e8f877c6892aadb0043e9a186
neutron/agent/linux/ip_lib.py
neutron/tests/functional/agent/linux/test_ip_lib.py
neutron/tests/functional/agent/test_l2_lb_agent.py
neutron/tests/functional/cmd/test_linuxbridge_cleanup.py
neutron/tests/unit/agent/linux/test_ip_lib.py