Skip to content

Commit

Permalink
[platform] Remove references to deprecated get_serial_number() method…
Browse files Browse the repository at this point in the history
… in Chassis class (sonic-net#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 sonic-net#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 sonic-net#5609
  • Loading branch information
jleveque authored Oct 18, 2020
1 parent 7f59a6e commit 8011edc
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def get_base_mac(self):
"""
return self._eeprom.get_mac()

def get_serial_number(self):
def get_serial(self):
"""
Retrieves the hardware serial number for the chassis
Returns:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def get_base_mac(self):
"""
return self._eeprom.get_mac()

def get_serial_number(self):
def get_serial(self):
"""
Retrieves the hardware serial number for the chassis
Returns:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,6 @@ def get_base_mac(self):
"""
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
Expand Down Expand Up @@ -252,7 +244,7 @@ def get_serial(self):
Returns:
string: Serial number of device
"""
return self.get_serial_number()
return self._eeprom.get_serial()

def get_status(self):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def get_base_mac(self):
"""
return self._eeprom.get_mac()

def get_serial_number(self):
def get_serial(self):
"""
Retrieves the hardware serial number for the chassis
Returns:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,6 @@ def get_base_mac(self):
"""
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,6 @@ def get_base_mac(self):
"""
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,6 @@ def get_base_mac(self):
"""
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,6 @@ def get_base_mac(self):
"""
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def get_part_number(self):
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def get_base_mac(self):
return self._eeprom.get_base_mac()


def get_serial_number(self):
def get_serial(self):
"""
Retrieves the hardware serial number for the chassis
Expand Down

0 comments on commit 8011edc

Please sign in to comment.