[platform] Remove references to deprecated get_serial_number() method in Chassis class (#5649)

The `get_serial_number()` method in the ChassisBase and ModuleBase classes was redundant, as the `get_serial()` method is inherited from the DeviceBase class. This method was removed from the base classes in sonic-platform-common and the submodule was updated in https://github.com/Azure/sonic-buildimage/pull/5625.

This PR aligns the existing vendor platform API implementations to remove the `get_serial_number()` methods and ensure the `get_serial()` methods are implemented, if they weren't previously.

Note that this PR does not modify the Dell platform API implementations, as this will be handled as part of https://github.com/Azure/sonic-buildimage/pull/5609
This commit is contained in:
Joe LeVeque 2020-10-17 22:00:14 -07:00 committed by GitHub
parent 7f59a6e46e
commit 8011edc307
No account linked to committer's email address
10 changed files with 6 additions and 49 deletions

View File

@ -93,7 +93,7 @@ class Chassis(ChassisBase):
"""
return self._eeprom.get_mac()
def get_serial_number(self):
def get_serial(self):
"""
Retrieves the hardware serial number for the chassis
Returns:

View File

@ -87,7 +87,7 @@ class Chassis(ChassisBase):
"""
return self._eeprom.get_mac()
def get_serial_number(self):
def get_serial(self):
"""
Retrieves the hardware serial number for the chassis
Returns:

View File

@ -91,14 +91,6 @@ class Chassis(ChassisBase):
"""
return self._eeprom.get_mac()
def get_serial_number(self):
"""
Retrieves the hardware serial number for the chassis
Returns:
A string containing the hardware serial number for this chassis.
"""
return self._eeprom.get_serial()
def get_system_eeprom_info(self):
"""
Retrieves the full content of system EEPROM information for the chassis
@ -252,7 +244,7 @@ class Chassis(ChassisBase):
Returns:
string: Serial number of device
"""
return self.get_serial_number()
return self._eeprom.get_serial()
def get_status(self):
"""

View File

@ -75,7 +75,7 @@ class Chassis(ChassisBase):
"""
return self._eeprom.get_mac()
def get_serial_number(self):
def get_serial(self):
"""
Retrieves the hardware serial number for the chassis
Returns:

View File

@ -101,15 +101,6 @@ class Chassis(ChassisBase):
"""
return self._eeprom.base_mac_addr()
def get_serial_number(self):
"""
Retrieves the hardware serial number for the chassis
Returns:
A string containing the hardware serial number for this chassis.
"""
return self._eeprom.serial_number_str()
def get_system_eeprom_info(self):
"""
Retrieves the full content of system EEPROM information for the chassis

View File

@ -126,14 +126,6 @@ class Chassis(ChassisBase):
"""
return self._eeprom.get_mac()
def get_serial_number(self):
"""
Retrieves the hardware serial number for the chassis
Returns:
A string containing the hardware serial number for this chassis.
"""
return self._eeprom.get_serial()
def get_system_eeprom_info(self):
"""
Retrieves the full content of system EEPROM information for the chassis

View File

@ -116,15 +116,6 @@ class Chassis(ChassisBase):
"""
return self._eeprom.base_mac_address()
def get_serial_number(self):
"""
Retrieves the hardware serial number for the chassis
Returns:
A string containing the hardware serial number for this chassis.
"""
return self._eeprom.serial_number_str()
def get_system_eeprom_info(self):
"""
Retrieves the full content of system EEPROM information for the chassis

View File

@ -119,15 +119,6 @@ class Chassis(ChassisBase):
"""
return self._eeprom.base_mac_addr()
def get_serial_number(self):
"""
Retrieves the hardware serial number for the chassis
Returns:
A string containing the hardware serial number for this chassis.
"""
return self._eeprom.serial_number_str()
def get_system_eeprom_info(self):
"""
Retrieves the full content of system EEPROM information for the chassis

View File

@ -86,7 +86,7 @@ class Chassis(ChassisBase):
return False
def get_serial_number(self):
def get_serial(self):
serial_number_list = self.get_parameter_value('Serial Number')
if serial_number_list:
serial_number = ''.join(serial_number_list)

View File

@ -287,7 +287,7 @@ class Chassis(ChassisBase):
return self._eeprom.get_base_mac()
def get_serial_number(self):
def get_serial(self):
"""
Retrieves the hardware serial number for the chassis