-
Notifications
You must be signed in to change notification settings - Fork 688
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
Fixed syslog error "ERR python3:- validateNamespace: Initialize global.." for sfpshow #3753
base: master
Are you sure you want to change the base?
Conversation
…for sfpshow Signed-off-by: Anand Mehra [email protected]
Signed-off-by: anamehra <[email protected]>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an error regarding the initialization of the global DB configuration when running transceiver commands on multi-ASIC systems by ensuring load_db_config() is called. The changes include enhanced test coverage for scenarios when the namespace is not provided and modifications to the CLI commands in sfpshow to call load_db_config().
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
tests/sfp_test.py | Added new tests to verify behavior of transceiver commands without namespace |
scripts/sfpshow | Updated CLI commands to call load_db_config() before namespace resolution |
Comments suppressed due to low confidence (1)
scripts/sfpshow:651
- [nitpick] Consider refactoring the repeated calls to load_db_config() across multiple CLI command handlers into a common helper function to reduce duplication and ensure consistency.
load_db_config()
@anamehra can you update the title and description to indicate this error is an error in syslog, not in command output? Thanks. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Hi @mihirpat1 , updated the description. Thanks |
Signed-off-by: Anand Mehra [email protected]
What I did
Fixed the "ERR python3: [ :- validateNamespace: Initialize global DB config using API SonicDBConfig::initializeGlobalConfig]"
error when running 'show interfaces transceiver <>' commands.
e.g. show interfaces transceiver info Ethernet0
The error is observed in syslogs but not on the command line.
This log was seen while running snappi_tests/multidut/pfc/test_m2o_fluctuating_lossless.py::test_m2o_fluctuating_lossless[multidut_port_info1] ERROR [100%]
E Match Messages:
E 2025 Jan 7 06:27:14.025905 svcstr2-8800-lc1-1 ERR python3: :- validateNamespace: Initialize global DB config using API SonicDBConfig::initializeGlobalConfig
E
E 2025 Jan 7 06:27:19.861658 svcstr2-8800-lc1-1 ERR python3: :- validateNamespace: Initialize global DB config using API SonicDBConfig::initializeGlobalConfig
E
E 2025 Jan 7 06:27:44.184059 svcstr2-8800-lc1-1 ERR python3: :- validateNamespace: Initialize global DB config using API SonicDBConfig::initializeGlobalConfig
How I did it
Call load_db_config before multi-asic method calls.
Added test coverage.
How to verify it
Run commands like 'show interfaces transceiver info Ethernet0' on multi-asic system and check syslogs.
It should not generate the ERR logs as mentioned above.
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)