[config] Fix 'config reload -l' command to get filename by default#1611
Merged
liat-grozovik merged 3 commits intosonic-net:masterfrom Dec 23, 2021
Merged
[config] Fix 'config reload -l' command to get filename by default#1611liat-grozovik merged 3 commits intosonic-net:masterfrom
liat-grozovik merged 3 commits intosonic-net:masterfrom
Conversation
25c3f5d to
17744f4
Compare
zhenggen-xu
previously approved these changes
May 13, 2021
liat-grozovik
previously approved these changes
Jun 15, 2021
qiluo-msft
reviewed
Jun 15, 2021
qiluo-msft
previously approved these changes
Jun 15, 2021
Contributor
|
please add unit test to prevent further regression. which pr caused the regression? |
Collaborator
|
Based on the log, it should be this PR that caused regression: #877 |
c2eb169
17744f4 to
c2eb169
Compare
Contributor
Author
Added Test cases as requested. |
qiluo-msft
reviewed
Jul 29, 2021
zhenggen-xu
previously approved these changes
Jul 29, 2021
qiluo-msft
previously approved these changes
Aug 6, 2021
Collaborator
|
@samaity Can you please share the status of this PR? When will this be merged? |
Collaborator
|
@samaity Can you sync to the latest code? |
added 3 commits
December 21, 2021 18:11
Signed-off-by: Sangita Maity <[email protected]>
Signed-off-by: Sangita Maity <[email protected]>
Signed-off-by: Sangita Maity <[email protected]>
082dff2 to
fd129de
Compare
Contributor
Author
done 👍 |
zhenggen-xu
approved these changes
Dec 23, 2021
liat-grozovik
approved these changes
Dec 23, 2021
judyjoseph
pushed a commit
that referenced
this pull request
Jan 9, 2022
…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 <[email protected]>
praveen-li
pushed a commit
to praveen-li/sonic-utilities
that referenced
this pull request
Feb 8, 2022
…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 <[email protected]> Conflicts: tests/config_test.py
praveen-li
pushed a commit
to praveen-li/sonic-utilities
that referenced
this pull request
Feb 11, 2022
…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 <[email protected]> Conflicts: tests/config_test.py
praveen-li
pushed a commit
to praveen-li/sonic-utilities
that referenced
this pull request
Mar 22, 2022
…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 <[email protected]> Conflicts: tests/config_test.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Sangita Maity [email protected]
What I did
Fix sonic-net/sonic-buildimage#7433
Right now
config reload -lis getting failed due to below error.I guess the problem is here in
sonic-utilitiesrepo. If user does not provide filename withconfig reload -l,command = "{} -j {} -v DEVICE_METADATA.localhost.hwsku".format(SONIC_CFGGEN_PATH, filename)will not providecfg_hwskui.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.