handle ethtool not installed and add known limitations to README
This commit is contained in:
parent
15faf59182
commit
0c5ca003a6
3 changed files with 10 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
import re
|
||||
import subprocess
|
||||
from shutil import which
|
||||
|
||||
# Originally from https://github.com/opencoff/useful-scripts/blob/master/linktest.py
|
||||
|
||||
|
@ -64,6 +65,8 @@ class Ethtool():
|
|||
return {'form_factor': r.groups()[0]}
|
||||
|
||||
def parse(self):
|
||||
if which('ethtool') is None:
|
||||
return None
|
||||
return {
|
||||
**self._parse_ethtool_output(),
|
||||
**self._parse_ethtool_module_output(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue