Skip to content

Commit 4d317af

Browse files
authored
[Mellanox] Fix typo in platform API (#12136)
- Why I did it Fix a typo in chassis platform API which causes the following error >>> import sonic_platform as P >>> c = P.platform.Platform().get_chassis() >>> sl = c.get_all_sfps() >>> sl[0].get_lpmode() Sep 28 07:48:33 INFO LOG: Initializing SX log with STDOUT as output file. False >>> del c Exception ignored in: <function Chassis.__del__ at 0x7f1d166ef8b0> Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/sonic_platform/chassis.py", line 126, in __del__ self.sfp_module.deinitialize_sdk_handle(sfp_module.SFP.shared_sdk_handle) NameError: name 'sfp_module' is not defined - How I did it Use self while using the SDK handle - How to verify it Manual test Signed-off-by: Stephen Sun <[email protected]>
1 parent f890606 commit 4d317af

File tree

1 file changed

+1
-1
lines changed
  • platform/mellanox/mlnx-platform-api/sonic_platform

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def __del__(self):
123123

124124
if self._sfp_list:
125125
if self.sfp_module.SFP.shared_sdk_handle:
126-
self.sfp_module.deinitialize_sdk_handle(sfp_module.SFP.shared_sdk_handle)
126+
self.sfp_module.deinitialize_sdk_handle(self.sfp_module.SFP.shared_sdk_handle)
127127

128128
@property
129129
def RJ45_port_list(self):

0 commit comments

Comments
 (0)