]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
replaces enumeration method used to get a list of interfaces
authorMatthew Thode <mthode@mthode.org>
Mon, 9 Feb 2015 17:02:58 +0000 (11:02 -0600)
committerMatthew Thode <mthode@mthode.org>
Sun, 15 Mar 2015 02:15:53 +0000 (21:15 -0500)
commitc717a6365c1aecb0e3957f0857a06f2334f99d5d
tree2c38cd8c5bf4fffe4cfc6aab338439c165fdba20
parent0244e59df0317b197f275dea3c368782490040da
replaces enumeration method used to get a list of interfaces

ip_lib was parsing tunnel links incorrectly. We can create interface
names with any character the filesystem supports (not '..', '/', ':').
Given this we do not know what to delimit on so parsing iproute2 output
is probably not a good idea.

I asked the iproute2 devs what the proper way we should get interface
names is and was told NOT to parse iproute2 output but to use something
like sysfs instead.  http://www.spinics.net/lists/netdev/msg316577.html

This patch pulls interfaces from sysfs (/sys/class/net) and verifies them
via checking if they are links (bonding creates files for instance and
needs to be skipped).

Currently it is not possible without jumping through a ton of hoops to
access a network namespace without iproute2 or cython, so we use ip to
run find to find the correct sysfs directory.  We also only call out to
iproute2 _ONLY_ if needed.

Change-Id: I07d1d297f07857d216649cccf717896574aac301
Closes-Bug: 1374663
etc/neutron/rootwrap.d/cisco-apic.filters
etc/neutron/rootwrap.d/dhcp.filters
etc/neutron/rootwrap.d/l3.filters
etc/neutron/rootwrap.d/linuxbridge-plugin.filters
etc/neutron/rootwrap.d/openvswitch-plugin.filters
neutron/agent/linux/ip_lib.py
neutron/tests/unit/test_linux_ip_lib.py