sonic-net / sonic-platform-daemons

Platform module daemons for SONiC
Other
25 stars 159 forks source link

Move DomInfoUpdateTask class to a separate file #552

Closed mihirpat1 closed 4 weeks ago

mihirpat1 commented 4 weeks ago

Description

We need to move the DomInfoUpdateTask class to a separate file to improve modularity and for better code maintainability.

https://github.com/sonic-net/sonic-platform-daemons/blob/ca812b0df105ecb98b90f2b9ef6b7aa24592222b/sonic-xcvrd/xcvrd/xcvrd.py#L1684

MSFT ADO - 29932076

Motivation and Context

Following is the summary of the changes done in this PR

  1. Added DOM-INFO-UPDATE: keyword to all syslogs being logged by the DomInfoUpdateTask class.
  2. Moved the below functions related to DB update from xcvrd.py to dom_mgr.py a. post_port_sfp_firmware_info_to_db b. post_port_dom_info_to_db c. update_port_transceiver_status_table_hw d. post_port_pm_info_to_db
  3. Consolidated beautify_transceiver_status_dict and beautify_pm_info_dict functions into beautify_info_dict function to avoid code duplication. This was done in dom_mgr.py.

How Has This Been Tested?

  1. Ensured that the output of the below CLI remains unchanged for a CMIS, CCMIS and 10G SFP based transceiver. show int transceiver eeprom -d $lport show int transceiver status $lport show int transceiver pm $lport

Also, ensured that the DOM thread is running by observing the below message in the syslog.

root@sonic:/var/log# cat /var/log/syslog | grep DOM
2024 Oct 24 16:50:56.946529 sn5600-s2 NOTICE pmon#xcvrd: DOM-INFO-UPDATE: Start DOM monitoring loop

Additional Information (Optional)

mssonicbld commented 4 weeks ago

Cherry-pick PR to 202405: https://github.com/sonic-net/sonic-platform-daemons/pull/553