1
0
Fork 0

net: fixed ring parser

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
Jaroslav Škarvada 2026-07-15 01:42:09 +02:00
parent 0eb28ac3d8
commit d958961db7
No known key found for this signature in database
GPG key ID: D8E1C00E076E840B

View file

@ -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]