[202012][multi-asic][sonic-config-engine]: Get PORT table from namespace config db#10475
Conversation
…ig db (sonic-net#7632) Why I did it portconfig.py gets PORT table from config_db if it is present. If not, port_config.ini files are parsed. For multi-asic platform, if namespace is passed to get_port_config(), config_db connection was done to host namespace always and not to asic specific namespace. Provides fix for: sonic-net#7161 How I did it Modify db connection function to connect to namespace config_db. (cherry picked from commit 2e305c9)
|
/azp run |
|
You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list. |
Modify autoneg value to be 1 instead of 'on'. Signed-off-by: Suvarna Meenakshi <[email protected]>
|
/azp run |
|
You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list. |
|
/azp run Azure.sonic-buildimage |
|
No pipelines are associated with this pull request. |
|
Azure Pipelines failed to run 1 pipeline(s). |
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines failed to run 1 pipeline(s). |
7700eef to
d060e79
Compare
| if namespace is not None: | ||
| swsscommon.SonicDBConfig.load_sonic_global_db_config(namespace=namespace) | ||
| config_db = swsscommon.ConfigDBConnector(use_unix_socket_path=True, namespace=namespace) | ||
| except Exception as e: |
There was a problem hiding this comment.
Was added to handle exception if thrown by load_sonic_global_db_config().
There was a problem hiding this comment.
looks like load_sonic_global_db_config() calls SonicDBConfig::initializeGlobalConfig() which already handled exceptions, and it should be good enough?
There was a problem hiding this comment.
I have created a PR : #10581 to remove this, I am working on unit-test failure, will merge that PR in master branch first and then take it in to 202012
There was a problem hiding this comment.
@qiluo-msft #10581 is merged in master branch to fix this comment. Can we merge this PR to 202012 branch and cherry-pick the other PR to 202012.
Why I did it
Cherry-pick of: #7632
portconfig.py gets PORT table from config_db if it is present. If not, port_config.ini files are parsed.
For multi-asic platform, if namespace is passed to get_port_config(), config_db connection was done to host namespace always and not to asic specific namespace.
Provides fix for: #7161
How I did it
Modify db connection function to connect to namespace config_db.
How to verify it
Unit-test passed.
Verified on multi-asic VS platform.
Which release branch to backport (provide reason below if selected)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)