From 0f6c29e46586f744334e36f7a46ac8f715a458f9 Mon Sep 17 00:00:00 2001 From: Mykola F <37578614+mykolaf@users.noreply.github.com> Date: Tue, 20 Nov 2018 22:58:50 +0200 Subject: [PATCH] [eeprom] modify output of decode-syseprom for mellanox platform (#2283) Signed-off-by: Mykola Faryma --- device/mellanox/x86_64-mlnx_msn2700-r0/plugins/eeprom.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/eeprom.py b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/eeprom.py index 61e37b51db..351288e849 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/eeprom.py +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/eeprom.py @@ -17,6 +17,7 @@ try: import warnings import os import sys + from cStringIO import StringIO from sonic_eeprom import eeprom_base from sonic_eeprom import eeprom_tlvinfo import subprocess @@ -30,3 +31,11 @@ class board(eeprom_tlvinfo.TlvInfoDecoder): def __init__(self, name, path, cpld_root, ro): self.eeprom_path = "/bsp/eeprom/vpd_info" super(board, self).__init__(self.eeprom_path, 0, '', True) + + def decode_eeprom(self, e): + original_stdout = sys.stdout + sys.stdout = StringIO() + eeprom_tlvinfo.TlvInfoDecoder.decode_eeprom(self, e) + decode_output = sys.stdout.getvalue() + sys.stdout = original_stdout + print(decode_output.replace('\0', ''))