network/library
Thomas Haller 9fbb2aa589 library: fix failure reading interface info because not ignoring non-interface names
The library fetches interface info by reading sysfs. However, "/sys/class/net/"
may contain certain files that are not interface names, like "bonding_master"

Skip over these files. Otherwise, the code fails with

  File "/tmp/ansible_HkmKOM/ansible_module_network_connections.py", line 347,
   in link_infos  b = SysUtil._link_infos_fetch()
  File "/tmp/ansible_HkmKOM/ansible_module_network_connections.py", line 323,
   in _link_infos_fetch  ifindex = SysUtil._link_read_ifindex(ifname)
  File "/tmp/ansible_HkmKOM/ansible_module_network_connections.py", line 302,
   in _link_read_ifindex  c = SysUtil._sysctl_read('/sys/class/net/' + ifname + '/ifindex')
  File "/tmp/ansible_HkmKOM/ansible_module_network_connections.py", line 293,
   in _sysctl_read  with open(filename, 'r') as f: IOError: [Errno 20] Not a directory: '/sys/class/net/bonding_masters/ifindex'
2017-05-03 16:09:07 +02:00
..
network_connections.py library: fix failure reading interface info because not ignoring non-interface names 2017-05-03 16:09:07 +02:00
test_network_connections.py library/test: make test compatible with Python 2.6 2017-05-02 15:29:10 +02:00