net: fixed ring parser
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
parent
0eb28ac3d8
commit
d958961db7
1 changed files with 11 additions and 11 deletions
|
|
@ -632,9 +632,9 @@ class NetTuningPlugin(hotplug.Plugin):
|
|||
# parse output of ethtool -a
|
||||
def _parse_pause_parameters(self, s):
|
||||
s = self._cmd.multiple_re_replace(\
|
||||
{"Autonegotiate": "autoneg",
|
||||
"RX": "rx",
|
||||
"TX": "tx"}, s)
|
||||
{"Autonegotiate:": "autoneg:",
|
||||
"RX:": "rx:",
|
||||
"TX:": "tx:"}, s)
|
||||
l = s.split("\n")[1:]
|
||||
l = [x for x in l if x != '' and not re.search(r"\[fixed\]", x)]
|
||||
return dict([x for x in [re.split(r":\s*", x) for x in l] if len(x) == 2])
|
||||
|
|
@ -644,10 +644,10 @@ class NetTuningPlugin(hotplug.Plugin):
|
|||
a = re.split(r"^Current hardware settings:$", s, flags=re.MULTILINE)
|
||||
s = a[1]
|
||||
s = self._cmd.multiple_re_replace(\
|
||||
{"RX": "rx",
|
||||
"RX Mini": "rx-mini",
|
||||
"RX Jumbo": "rx-jumbo",
|
||||
"TX": "tx"}, s)
|
||||
{"RX:": "rx:",
|
||||
"RX Mini:": "rx-mini:",
|
||||
"RX Jumbo:": "rx-jumbo:",
|
||||
"TX:": "tx:"}, s)
|
||||
l = s.split("\n")
|
||||
l = [x for x in l if x != '']
|
||||
l = [x for x in [re.split(r":\s*", x) for x in l] if len(x) == 2]
|
||||
|
|
@ -658,10 +658,10 @@ class NetTuningPlugin(hotplug.Plugin):
|
|||
a = re.split(r"^Current hardware settings:$", s, flags=re.MULTILINE)
|
||||
s = a[1]
|
||||
s = self._cmd.multiple_re_replace(\
|
||||
{"RX": "rx",
|
||||
"TX": "tx",
|
||||
"Other": "other",
|
||||
"Combined": "combined"}, s)
|
||||
{"RX:": "rx:",
|
||||
"TX:": "tx:",
|
||||
"Other:": "other:",
|
||||
"Combined:": "combined:"}, s)
|
||||
l = s.split("\n")
|
||||
l = [x for x in l if x != '']
|
||||
l = [x for x in [re.split(r":\s*", x) for x in l] if len(x) == 2]
|
||||
|
|
|
|||
Loading…
Reference in a new issue