[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 <stephens@nvidia.com>
This commit is contained in:
parent
f890606d82
commit
4d317aff94
@ -123,7 +123,7 @@ class Chassis(ChassisBase):
|
|||||||
|
|
||||||
if self._sfp_list:
|
if self._sfp_list:
|
||||||
if self.sfp_module.SFP.shared_sdk_handle:
|
if self.sfp_module.SFP.shared_sdk_handle:
|
||||||
self.sfp_module.deinitialize_sdk_handle(sfp_module.SFP.shared_sdk_handle)
|
self.sfp_module.deinitialize_sdk_handle(self.sfp_module.SFP.shared_sdk_handle)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def RJ45_port_list(self):
|
def RJ45_port_list(self):
|
||||||
|
Reference in New Issue
Block a user