Skip to content

Move DomInfoUpdateTask class to a separate file#552

Merged
prgeor merged 3 commits intosonic-net:masterfrom
mihirpat1:dom_separation
Oct 24, 2024
Merged

Move DomInfoUpdateTask class to a separate file#552
prgeor merged 3 commits intosonic-net:masterfrom
mihirpat1:dom_separation

Conversation

@mihirpat1
Copy link
Copy Markdown
Contributor

@mihirpat1 mihirpat1 commented Oct 24, 2024

Description

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

class DomInfoUpdateTask(threading.Thread):

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)

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
@mihirpat1 mihirpat1 marked this pull request as ready for review October 24, 2024 22:00
@prgeor prgeor merged commit f169f86 into sonic-net:master Oct 24, 2024
mssonicbld pushed a commit to mssonicbld/sonic-platform-daemons that referenced this pull request Oct 25, 2024
* Move DomInfoUpdateTask class to a separate file

Signed-off-by: Mihir Patel <patelmi@microsoft.com>

* Improved code coverage

* Improved code coverage

---------

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202405: #553

mssonicbld pushed a commit that referenced this pull request Oct 25, 2024
* Move DomInfoUpdateTask class to a separate file

Signed-off-by: Mihir Patel <patelmi@microsoft.com>

* Improved code coverage

* Improved code coverage

---------

Signed-off-by: Mihir Patel <patelmi@microsoft.com>
lotus-nexthop pushed a commit to lotus-nexthop/sonic-platform-daemons that referenced this pull request Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants