Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[barefoot] Tmp fix vendor_rev #22

Merged
merged 1 commit into from
Dec 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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())
Expand Down