Kintyre / shinnecock-agent

Standalone client for Kintyre Speed Testing
2 stars 0 forks source link

ifcfg requires ifconfig command to be available #17

Closed ljonsson closed 6 years ago

ljonsson commented 6 years ago

On newer linux distro releases where the old style network config commands such as ifconfig, netstat and route have been abandoned in favor of the ip command, the ifcfg.interfaces() call will fail to identify available interfaces.

One workaround is to require the net-tools package to be installed.

ljonsson commented 6 years ago
ljonsson@op> python       
>>> import ifcfg                          
>>> interfaces
{}                                   
>>>
ljonsson@op> sudo apt-get install net-tools
ljonsson@op> python
>>> import ifcfg
>>> for i, j in ifcfg.interfaces().items():
...     print i
...
enp2s0
lo
tun0
lowell80 commented 6 years ago

I believe the ip command is tried before ifconfig. So new distros should work fine, there should be no need for net-tools.

But even if ifcfg returns no interfaces, the agent should still run the speed test, just with much less metadata. If not, that's a separate bug.

What version of ifcfg? Should be able to find it with

import ifcfg
print(ifcfg.__version__)

Or

pip freeze
ljonsson commented 6 years ago

0.16 which is the latest I think. I see it does have something in there about running ip on newer systems but for some reason it didn't work. I'll try it again.

lowell80 commented 6 years ago

Related ticket: https://github.com/ftao/python-ifcfg/issues/30

benjaoming commented 6 years ago

I hope 0.17 fixes this for you, otherwise please feel free to open up another PR and we'll do another release!

lowell80 commented 6 years ago

Thanks @ljonsson and @benjaoming for all your hard work on this. Looks good to me based on some quick local test. @ljonsson can we close this?