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

[action] [PR:17440] [Dell] S6100 - Update EEPROM API serial_number_str to return service tag instead of serial number #17492

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
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 @@ -207,7 +207,7 @@ def get_serial(self):
Returns:
string: Serial number of chassis
"""
return self._eeprom.serial_str()
return self._eeprom.serial_number_str()

def get_status(self):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,14 @@ def __init__(self, i2c_line=0, iom_eeprom=False):
self.eeprom_tlv_dict[mac_code] = '00:00:00:00:00:00'

def serial_number_str(self):
(is_valid, results) = self.get_tlv_field(
self.eeprom_data, self._TLV_CODE_SERIAL_NUMBER)
# For Chassis, return service tag instead of serial number
if not self.is_module:
(is_valid, results) = self.get_tlv_field(
self.eeprom_data, self._TLV_CODE_SERVICE_TAG)
else:
(is_valid, results) = self.get_tlv_field(
self.eeprom_data, self._TLV_CODE_SERIAL_NUMBER)

if not is_valid:
return "N/A"

Expand Down Expand Up @@ -113,14 +119,6 @@ def part_number_str(self):

return results[2].decode('ascii')

def serial_str(self):
(is_valid, results) = self.get_tlv_field(
self.eeprom_data, self._TLV_CODE_SERVICE_TAG)
if not is_valid:
return "N/A"

return results[2].decode('ascii')

def revision_str(self):
(is_valid, results) = self.get_tlv_field(
self.eeprom_data, self._TLV_CODE_LABEL_REVISION)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def get_serial(self):
Returns:
string: Serial number of module
"""
return self._eeprom.serial_str()
return self._eeprom.serial_number_str()

def get_status(self):
"""
Expand Down