[Dell] S6100 - Update EEPROM API serial_number_str to return service tag instead of serial number (#17440)

To modify EEPROM API serial_number_str to return service tag instead of serial number in Dell S6100.
Ref PR: #1239

How I did it
Update EEPROM API serial_number_str to return service tag instead of serial number.

How to verify it
Verify decode-syseeprom -s returns service tag in Dell S6100.
This commit is contained in:
Arun Saravanan Balachandran 2023-12-07 23:38:42 +05:30 committed by mssonicbld
parent 0cb0891227
commit 9dbb016ad8
3 changed files with 10 additions and 12 deletions

View File

@ -216,7 +216,7 @@ class Chassis(ChassisBase):
Returns: Returns:
string: Serial number of chassis string: Serial number of chassis
""" """
return self._eeprom.serial_str() return self._eeprom.serial_number_str()
def get_status(self): def get_status(self):
""" """

View File

@ -83,8 +83,14 @@ class Eeprom(eeprom_tlvinfo.TlvInfoDecoder):
self.eeprom_tlv_dict[mac_code] = '00:00:00:00:00:00' self.eeprom_tlv_dict[mac_code] = '00:00:00:00:00:00'
def serial_number_str(self): def serial_number_str(self):
# 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( (is_valid, results) = self.get_tlv_field(
self.eeprom_data, self._TLV_CODE_SERIAL_NUMBER) self.eeprom_data, self._TLV_CODE_SERIAL_NUMBER)
if not is_valid: if not is_valid:
return "N/A" return "N/A"
@ -118,14 +124,6 @@ class Eeprom(eeprom_tlvinfo.TlvInfoDecoder):
return results[2].decode('ascii') 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): def revision_str(self):
(is_valid, results) = self.get_tlv_field( (is_valid, results) = self.get_tlv_field(
self.eeprom_data, self._TLV_CODE_LABEL_REVISION) self.eeprom_data, self._TLV_CODE_LABEL_REVISION)

View File

@ -139,7 +139,7 @@ class Module(ModuleBase):
Returns: Returns:
string: Serial number of module string: Serial number of module
""" """
return self._eeprom.serial_str() return self._eeprom.serial_number_str()
def get_status(self): def get_status(self):
""" """