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

[Dell S6100]: EEPROM plugin overrides serial_number_str() to return service tag instead of serial number #1239

Merged
merged 2 commits into from
Dec 15, 2017
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
10 changes: 10 additions & 0 deletions device/dell/x86_64-dell_s6100_c2538-r0/plugins/eeprom.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,13 @@ def __init__(self, name, path, cpld_root, ro):
self.eeprom_path = "/sys/class/i2c-adapter/i2c-2/2-0050/eeprom"
super(board, self).__init__(self.eeprom_path, 0, '', True)

def serial_number_str(self, e):
"""Return service tag instead of serial number"""

(is_valid, results) = self.get_tlv_field(e, self._TLV_CODE_SERVICE_TAG)
if is_valid == False:
return "Bad service tag"

# 'results' is a list containing 3 elements, type (int), length (int),
# and value (string) of the requested TLV
return results[2]