-
Notifications
You must be signed in to change notification settings - Fork 669
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
[config] Fix 'config reload -l' command to get filename by default #1611
Conversation
25c3f5d
to
17744f4
Compare
please add unit test to prevent further regression. which pr caused the regression? |
Based on the log, it should be this PR that caused regression: #877 |
c2eb169
17744f4
to
c2eb169
Compare
Added Test cases as requested. |
@samaity Can you please share the status of this PR? When will this be merged? |
@samaity Can you sync to the latest code? |
Signed-off-by: Sangita Maity <samaity@linkedin.com>
Signed-off-by: Sangita Maity <samaity@linkedin.com>
Signed-off-by: Sangita Maity <samaity@linkedin.com>
082dff2
to
fd129de
Compare
done 👍 |
…1611) Fix sonic-net/sonic-buildimage#7433 Right now config reload -l is getting failed due to an error. I guess the problem is here in sonic-utilities repo. If user does not provide filename with config reload -l, command = "{} -j {} -v DEVICE_METADATA.localhost.hwsku".format(SONIC_CFGGEN_PATH, filename) will not provide cfg_hwsku i.e. hwsku parameter as it should which will later cause problem here command = "{} -H -k {} --write-to-db".format(SONIC_CFGGEN_PATH, cfg_hwsku) as hwsku is not available around that time. that's why we notice errors like No such file or directory: 'None' as pasted in this issue. - How I did it To Fix the issue, moved the part where the code gets cfg_hwsku command = "{} -j {} -v DEVICE_METADATA.localhost.hwsku".format(SONIC_CFGGEN_PATH, file) to the same location it needed as we get filename by default. - How to verify it 'sudo config reload -l' Added test cases. Signed-off-by: Sangita Maity <samaity@linkedin.com>
…onic-net#1611) Fix sonic-net/sonic-buildimage#7433 Right now config reload -l is getting failed due to an error. I guess the problem is here in sonic-utilities repo. If user does not provide filename with config reload -l, command = "{} -j {} -v DEVICE_METADATA.localhost.hwsku".format(SONIC_CFGGEN_PATH, filename) will not provide cfg_hwsku i.e. hwsku parameter as it should which will later cause problem here command = "{} -H -k {} --write-to-db".format(SONIC_CFGGEN_PATH, cfg_hwsku) as hwsku is not available around that time. that's why we notice errors like No such file or directory: 'None' as pasted in this issue. - How I did it To Fix the issue, moved the part where the code gets cfg_hwsku command = "{} -j {} -v DEVICE_METADATA.localhost.hwsku".format(SONIC_CFGGEN_PATH, file) to the same location it needed as we get filename by default. - How to verify it 'sudo config reload -l' Added test cases. Signed-off-by: Sangita Maity <samaity@linkedin.com> Conflicts: tests/config_test.py
…onic-net#1611) Fix sonic-net/sonic-buildimage#7433 Right now config reload -l is getting failed due to an error. I guess the problem is here in sonic-utilities repo. If user does not provide filename with config reload -l, command = "{} -j {} -v DEVICE_METADATA.localhost.hwsku".format(SONIC_CFGGEN_PATH, filename) will not provide cfg_hwsku i.e. hwsku parameter as it should which will later cause problem here command = "{} -H -k {} --write-to-db".format(SONIC_CFGGEN_PATH, cfg_hwsku) as hwsku is not available around that time. that's why we notice errors like No such file or directory: 'None' as pasted in this issue. - How I did it To Fix the issue, moved the part where the code gets cfg_hwsku command = "{} -j {} -v DEVICE_METADATA.localhost.hwsku".format(SONIC_CFGGEN_PATH, file) to the same location it needed as we get filename by default. - How to verify it 'sudo config reload -l' Added test cases. Signed-off-by: Sangita Maity <samaity@linkedin.com> Conflicts: tests/config_test.py
…onic-net#1611) Fix sonic-net/sonic-buildimage#7433 Right now config reload -l is getting failed due to an error. I guess the problem is here in sonic-utilities repo. If user does not provide filename with config reload -l, command = "{} -j {} -v DEVICE_METADATA.localhost.hwsku".format(SONIC_CFGGEN_PATH, filename) will not provide cfg_hwsku i.e. hwsku parameter as it should which will later cause problem here command = "{} -H -k {} --write-to-db".format(SONIC_CFGGEN_PATH, cfg_hwsku) as hwsku is not available around that time. that's why we notice errors like No such file or directory: 'None' as pasted in this issue. - How I did it To Fix the issue, moved the part where the code gets cfg_hwsku command = "{} -j {} -v DEVICE_METADATA.localhost.hwsku".format(SONIC_CFGGEN_PATH, file) to the same location it needed as we get filename by default. - How to verify it 'sudo config reload -l' Added test cases. Signed-off-by: Sangita Maity <samaity@linkedin.com> Conflicts: tests/config_test.py
Signed-off-by: Sangita Maity samaity@linkedin.com
What I did
Fix sonic-net/sonic-buildimage#7433
Right now
config reload -l
is getting failed due to below error.I guess the problem is here in
sonic-utilities
repo. If user does not provide filename withconfig reload -l
,command = "{} -j {} -v DEVICE_METADATA.localhost.hwsku".format(SONIC_CFGGEN_PATH, filename)
will not providecfg_hwsku
i.e. hwsku parameter as it should which will later cause problem herecommand = "{} -H -k {} --write-to-db".format(SONIC_CFGGEN_PATH, cfg_hwsku)
as hwsku is not available around that time.that's why we notice errors like
No such file or directory: 'None'
as pasted in this issue.How I did it
To Fix the issue, moved the part where the code gets cfg_hwsku
command = "{} -j {} -v DEVICE_METADATA.localhost.hwsku".format(SONIC_CFGGEN_PATH, file)
to the same location it needed as we get filename by default.How to verify it
Before the Fix
After the fix
Added Test cases.