sonic-buildimage/platform
Stephen Sun b3a283366c
Fix issue: exception occurred during chassis object being destroyed (#7446)
The following error message is observed during chassis object being destroyed

"Exception ignored in: <function Chassis.__del__ at 0x7fd22165cd08>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/sonic_platform/chassis.py", line 83, in __del__
ImportError: sys.meta_path is None, Python is likely shutting down
The chassis tries to import deinitialize_sdk_handle during being destroyed for the purpose of releasing the sdk_handle.
However, importing another module during shutting down can cause the error because some of the fundamental infrastructures are no longer available."

This error occurs when a chassis object is created and then destroyed in the Python shell.

- How I did it
To fix it, record the deinitialize_sdk_handle in the chassis object when sdk_handle is being initialized and call the deinitialize handler when the chassis object is being destroyed

- How to verify it
Manually test.
2021-04-29 11:33:39 +03:00
..
barefoot [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
broadcom Updated bcmsai to 4.3.3.5-1 to include MMU fixes and others (#7440) 2021-04-27 16:33:41 -07:00
cavium [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
centec [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
centec-arm64 [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
generic [dockers] Rename 'docker-snmp-sv2' to 'docker-snmp' (#4699) 2020-06-11 16:04:23 -07:00
innovium [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
marvell [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
marvell-arm64 [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
marvell-armhf [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
mellanox Fix issue: exception occurred during chassis object being destroyed (#7446) 2021-04-29 11:33:39 +03:00
nephos [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00
p4 Add support to start fdbsyncd when orchagent docker starts (#5979) 2020-12-24 18:36:01 -08:00
pddf Invoking python3 installation for PDDF 2.0 PAI package (#7100) 2021-04-08 08:21:17 -07:00
template Add gearbox phy device files and a new physyncd docker to support VS gearbox phy feature (#4851) 2020-09-25 08:32:44 -07:00
vs [dockers] label SONiC Docker with manifest (#5939) 2021-04-26 13:51:50 -07:00