Skip to content

Commit f890606

Browse files
Revert "[Mellanox] Redirect ethtool stderr to subprocess for better error log (#12038)" (#12183)
This reverts commit 9750cb4. There is a PR to handle 202205 branch revert: #12184 - Why I did it The PR to be reverted introduced many notice logs every 1 minute if SFP is not plugged: Cannot get module EEPROM information: Input/output error Before the "bad" PR, the message format is like this: INFO pmon#supervisord: xcvrd Cannot get module EEPROM information: Input/output error It was truncated by rsyslog because every message is the same. However, the "bad" PR introduces SFP index to the message: NOTICE pmon#xcvrd: Failed to get EEPROM data for sfp 39: Cannot get module EEPROM information: Input/output error Rsyslog no longer truncate such log and many such messages are flooded to syslog. - How I did it Revert the PR - How to verify it Manual test
1 parent 7666af9 commit f890606

File tree

1 file changed

+1
-3
lines changed
  • platform/mellanox/mlnx-platform-api/sonic_platform

1 file changed

+1
-3
lines changed

platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,16 +359,14 @@ def _read_eeprom_specific_bytes(self, offset, num_bytes):
359359
try:
360360
output = subprocess.check_output(ethtool_cmd,
361361
shell=True,
362-
universal_newlines=True,
363-
stderr=subprocess.PIPE)
362+
universal_newlines=True)
364363
output_lines = output.splitlines()
365364
first_line_raw = output_lines[0]
366365
if "Offset" in first_line_raw:
367366
for line in output_lines[2:]:
368367
line_split = line.split()
369368
eeprom_raw = eeprom_raw + line_split[1:]
370369
except subprocess.CalledProcessError as e:
371-
logger.log_notice("Failed to get EEPROM data for sfp {}: {}".format(self.index, e.stderr))
372370
return None
373371

374372
eeprom_raw = list(map(lambda h: int(h, base=16), eeprom_raw))

0 commit comments

Comments
 (0)