Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sfputil CLI failure for multi-asic platforms #3168

Merged
merged 4 commits into from
Feb 23, 2024

Conversation

longhuan-cisco
Copy link
Contributor

What I did

This PR is to fix issue #3167

Basically sfputil Cli became broken on multi-asic platforms after introduction of sonic-net/sonic-buildimage#10960 which removed the initialization of global DB config from portconfig.py (library side) and expects application to do it, but here application side (sfputil) was not updated accordingly.

How I did it

Add load_db_config call to sfputil for initialization

How to verify it

Before fix:

root@sonic:/home# sfputil show presence                                                                                                                                                                                     
Error reading port info (:- validateNamespace: Initialize global DB config using API SonicDBConfig::initializeGlobalConfig)                                                                                                       

After fix:

root@sonic:/home# sfputil show presence
Port         Presence                                   
-----------  -----------                                
Ethernet0    Present                                    
Ethernet4    Not present                                
Ethernet8    Present                                    
Ethernet12   Present                                    
Ethernet16   Not present       
...

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

@longhuan-cisco
Copy link
Contributor Author

@prgeor @abdosi @SuvarnaMeenakshi @bmridul
Please take a look, thanks

Copy link
Contributor

@SuvarnaMeenakshi SuvarnaMeenakshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

abdosi
abdosi previously approved these changes Feb 21, 2024
prgeor
prgeor previously approved these changes Feb 21, 2024
@prgeor
Copy link
Contributor

prgeor commented Feb 21, 2024

@prgeor @abdosi @SuvarnaMeenakshi @bmridul Please take a look, thanks

@longhuan-cisco please test this on NON-multi asic platform

@longhuan-cisco
Copy link
Contributor Author

@longhuan-cisco please test this on NON-multi asic platform

@prgeor Verified on non-multi-asic platforms also:

root@sonic:/home# ls /run/redis/sonic-db/
database_config.json
root@sonic:/home# sfputil show presence
Port         Presence
-----------  -----------
Ethernet0    Present
Ethernet8    Present
Ethernet16   Present
Ethernet24   Present
Ethernet32   Present
...

@xumia
Copy link
Collaborator

xumia commented Feb 22, 2024

/azp run Azure.sonic-utilities

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@qiluo-msft
Copy link
Contributor

/azp run Azure.sonic-utilities

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prgeor
Copy link
Contributor

prgeor commented Feb 22, 2024

@longhuan-cisco please check the code coverage

@longhuan-cisco
Copy link
Contributor Author

@longhuan-cisco please check the code coverage

@prgeor addressed it.

@prgeor prgeor merged commit 7670609 into sonic-net:master Feb 23, 2024
5 checks passed
longhuan-cisco added a commit to longhuan-cisco/sonic-utilities that referenced this pull request Feb 27, 2024
* Fix sfputil invalid namesapce error

* Add test case for loading port configuration

* Improve cov
abdosi pushed a commit that referenced this pull request Feb 29, 2024
Fix sfputil CLI failure for multi-asic platforms
wumiaont pushed a commit to wumiaont/sonic-utilities that referenced this pull request Apr 22, 2024
* Fix sfputil invalid namesapce error

* Add test case for loading port configuration

* Improve cov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants