-
Notifications
You must be signed in to change notification settings - Fork 1.5k
multi-asic: sonic-cfggen fails to get right port_config file when -n option is provided #7161
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
Comments
Please provide exact sonic-cfggen command being used |
Issue seen only on 202012 and not seen in 201911.
|
For a 3 asic system, here is the HWSKU directory structure: command run: The command doe snot pick the right port_config.ini file which should be /usr/share/sonic/device/platform-x/hwsku/0/port_config.ini when sonic-cfggen makes a call to device_info.get_path_to_port_config_file(hwsku), the return value is 'None' As a workaround, I passed -p <port_config.ini> option and that worked fine as it bypass the get_path_to_port_config_file () call. |
Hi @SuvarnaMeenakshi could you please provide input, thanks. |
I will raise a PR to fix sonic-cfggen to take namespace parameter. |
@SuvarnaMeenakshi looks like sonic-net/sonic-swss-common#470 handles the swsscommon issue reported in #7155 Update: missed the update for #7632, will pick this change and verify. Thanks |
yes; it is here: #7632 |
…ig db (#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: #7161 How I did it Modify db connection function to connect to namespace config_db.
…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.
Fixed in #7632 |
…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)
…ace config db (#10475) 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.
Description
On 202012, multi-asic system, when I run sonic-cfggen to genretae config_dbX.json for am asic_id X, the right port config file is not picked. sonic-cfggen calls device_info.get_path_to_port_config_file method with hwsku but no asic_id. The method returns none. Sonic-cfggen fails to get the right port_config.ini path.
def get_path_to_port_config_file(hwsku=None, asic=None):
"""
Retrieves the path to the device's port configuration file
.
.
asic: a string , asic argument should be passed on multi-ASIC devices only,
it should be omitted on single-ASIC platforms.
Moreover device_info.py use swsssdk for ConfigDBConnector, SonicDBConfig, SonicV2Connector while sonic-cfggen is moved to libswsscommon, which may cause other db issue as seen in #7155
Steps to reproduce the issue:
Describe the results you received:
Describe the results you expected:
Output of
show version
:Additional information you deem important (e.g. issue happens only occasionally):
The text was updated successfully, but these errors were encountered: