mirror of
https://github.com/xcat2/confluent.git
synced 2025-01-16 12:47:50 +00:00
Fix for unexpected entries in /sys/class/net
For example, in a bonding configuration there is a file there, not just directories with ifindex entries.
This commit is contained in:
parent
8774ae0305
commit
12cbfff24f
@ -31,6 +31,8 @@ def list_interface_indexes():
|
||||
# For now be linux specific
|
||||
try:
|
||||
for iface in os.listdir('/sys/class/net/'):
|
||||
if not os.path.exists('/sys/class/net/{0}/ifindex'.format(iface)):
|
||||
continue
|
||||
ifile = open('/sys/class/net/{0}/ifindex'.format(iface), 'r')
|
||||
intidx = int(ifile.read())
|
||||
ifile.close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user