From 9c37644498e3d32af5e15234ff1b780c0bf4bbd6 Mon Sep 17 00:00:00 2001 From: Volodymyr Boiko Date: Wed, 15 Dec 2021 19:23:59 +0200 Subject: [PATCH] [barefoot] Tmp fix vendor_rev (#22) Signed-off-by: Volodymyr Boyko --- .../sonic_platform/sfp.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/sfp.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/sfp.py index 6271ca32b234..5bb5f49bd92b 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/sfp.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/sfp.py @@ -310,7 +310,11 @@ def reset(self): def get_transceiver_info(self): with Sfp.sfputil.eeprom_action() as u: - return u.get_transceiver_info_dict(self.port_num) + info = u.get_transceiver_info_dict(self.port_num) + # XXX https://github.com/Azure/sonic-platform-common/issues/250 + if "vendor_rev" not in info: + info["vendor_rev"] = info.get("hardware_rev", "N/A") + return info def get_transceiver_bulk_status(self): status = dict() @@ -392,7 +396,7 @@ def get_error_description(self): def get_revision(self): info = self.get_transceiver_info() - return info.get("hardware_rev", "N/A") + return info.get("vendor_rev", "N/A") def get_status(self): return self.get_presence() and bool(self.get_transceiver_bulk_status())