MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / net_interfaces

Function net_interfaces

network_diagnostics.py:1999–2002  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1997 typically don't support this -> fields stay None."""
1998 d = {'speed': None, 'duplex': None, 'autoneg': None, 'link_detected': None}
1999 res = _run(['ethtool', iface], timeout=6)
2000 if res['rc'] != 0:
2001 return d
2002 out = res['out']
2003 m = re.search(r'Speed:\s*(.+)', out)
2004 if m and 'Unknown' not in m.group(1):
2005 d['speed'] = m.group(1).strip()

Callers

nothing calls this directly

Calls 3

_logFunction · 0.85
do_interfacesFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected