Skip to content

Commit 8011edc

Browse files
authored
[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 #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 #5609
1 parent 7f59a6e commit 8011edc

File tree

10 files changed

+6
-49
lines changed
  • device
    • accton/x86_64-accton_as7116_54x-r0/sonic_platform
    • celestica
  • platform
    • barefoot/sonic-platform-modules-bfn-montara/sonic_platform
    • broadcom
      • sonic-platform-modules-cel/services/platform_api/sonic_platform
      • sonic-platform-modules-inventec
      • sonic-platform-modules-juniper/sonic_platform
    • mellanox/mlnx-platform-api/sonic_platform

10 files changed

+6
-49
lines changed

device/accton/x86_64-accton_as7116_54x-r0/sonic_platform/chassis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def get_base_mac(self):
9393
"""
9494
return self._eeprom.get_mac()
9595

96-
def get_serial_number(self):
96+
def get_serial(self):
9797
"""
9898
Retrieves the hardware serial number for the chassis
9999
Returns:

device/celestica/x86_64-cel_e1031-r0/sonic_platform/chassis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def get_base_mac(self):
8787
"""
8888
return self._eeprom.get_mac()
8989

90-
def get_serial_number(self):
90+
def get_serial(self):
9191
"""
9292
Retrieves the hardware serial number for the chassis
9393
Returns:

device/celestica/x86_64-cel_seastone-r0/sonic_platform/chassis.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,6 @@ def get_base_mac(self):
9191
"""
9292
return self._eeprom.get_mac()
9393

94-
def get_serial_number(self):
95-
"""
96-
Retrieves the hardware serial number for the chassis
97-
Returns:
98-
A string containing the hardware serial number for this chassis.
99-
"""
100-
return self._eeprom.get_serial()
101-
10294
def get_system_eeprom_info(self):
10395
"""
10496
Retrieves the full content of system EEPROM information for the chassis
@@ -252,7 +244,7 @@ def get_serial(self):
252244
Returns:
253245
string: Serial number of device
254246
"""
255-
return self.get_serial_number()
247+
return self._eeprom.get_serial()
256248

257249
def get_status(self):
258250
"""

device/celestica/x86_64-cel_silverstone-r0/sonic_platform/chassis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def get_base_mac(self):
7575
"""
7676
return self._eeprom.get_mac()
7777

78-
def get_serial_number(self):
78+
def get_serial(self):
7979
"""
8080
Retrieves the hardware serial number for the chassis
8181
Returns:

platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/chassis.py

-9
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,6 @@ def get_base_mac(self):
101101
"""
102102
return self._eeprom.base_mac_addr()
103103

104-
def get_serial_number(self):
105-
"""
106-
Retrieves the hardware serial number for the chassis
107-
108-
Returns:
109-
A string containing the hardware serial number for this chassis.
110-
"""
111-
return self._eeprom.serial_number_str()
112-
113104
def get_system_eeprom_info(self):
114105
"""
115106
Retrieves the full content of system EEPROM information for the chassis

platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/chassis.py

-8
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,6 @@ def get_base_mac(self):
126126
"""
127127
return self._eeprom.get_mac()
128128

129-
def get_serial_number(self):
130-
"""
131-
Retrieves the hardware serial number for the chassis
132-
Returns:
133-
A string containing the hardware serial number for this chassis.
134-
"""
135-
return self._eeprom.get_serial()
136-
137129
def get_system_eeprom_info(self):
138130
"""
139131
Retrieves the full content of system EEPROM information for the chassis

platform/broadcom/sonic-platform-modules-inventec/d6356/sonic_platform/chassis.py

-9
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,6 @@ def get_base_mac(self):
116116
"""
117117
return self._eeprom.base_mac_address()
118118

119-
def get_serial_number(self):
120-
"""
121-
Retrieves the hardware serial number for the chassis
122-
123-
Returns:
124-
A string containing the hardware serial number for this chassis.
125-
"""
126-
return self._eeprom.serial_number_str()
127-
128119
def get_system_eeprom_info(self):
129120
"""
130121
Retrieves the full content of system EEPROM information for the chassis

platform/broadcom/sonic-platform-modules-inventec/d7054q28b/sonic_platform/chassis.py

-9
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,6 @@ def get_base_mac(self):
119119
"""
120120
return self._eeprom.base_mac_addr()
121121

122-
def get_serial_number(self):
123-
"""
124-
Retrieves the hardware serial number for the chassis
125-
126-
Returns:
127-
A string containing the hardware serial number for this chassis.
128-
"""
129-
return self._eeprom.serial_number_str()
130-
131122
def get_system_eeprom_info(self):
132123
"""
133124
Retrieves the full content of system EEPROM information for the chassis

platform/broadcom/sonic-platform-modules-juniper/sonic_platform/chassis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def get_part_number(self):
8686
return False
8787

8888

89-
def get_serial_number(self):
89+
def get_serial(self):
9090
serial_number_list = self.get_parameter_value('Serial Number')
9191
if serial_number_list:
9292
serial_number = ''.join(serial_number_list)

platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def get_base_mac(self):
287287
return self._eeprom.get_base_mac()
288288

289289

290-
def get_serial_number(self):
290+
def get_serial(self):
291291
"""
292292
Retrieves the hardware serial number for the chassis
293293

0 commit comments

Comments
 (0)