-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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-setup factory failed to parse platform.json #9643
Comments
@qiluo-msft @samaity Have a look, Please |
@msosyak can you elaborate what is the significance of step 2? In other words, if you execute step 1,3,4, will there be any issue? Also, please attach show techsupport to the ticket. |
@yxieca Yes, you are right, if skip step 2 there will no issue. |
I debug a little bit and find this line throw the error string. @samaity Could you please check?
As a workaround, change the boolean to string will pass. "psus": [
{
"name": "psu-1",
"temperature": "false"
},
{
"name": "psu-2",
"temperature": "false"
}
], |
@qiluo-msft , but this change will cause TC failure which expect True or False but not string |
…0224) #### Why I did it To fix #9643 #### How I did it Instead of ast.literal_eval added python2 compat code for json strings unicode -> str convertion. We need python2 compatibility since py2 sonic config engine (buster/sonic_config_engine-1.0-py2-none-any.whl target) is still included into the build (ENABLE_PY2_MODULES flag is set for buster). Once we abandon buster and python2, this compat and ast.literal_eval could be cleaned up all through the code base. #### How to verify it run steps from the linked issue
…0224) #### Why I did it To fix #9643 #### How I did it Instead of ast.literal_eval added python2 compat code for json strings unicode -> str convertion. We need python2 compatibility since py2 sonic config engine (buster/sonic_config_engine-1.0-py2-none-any.whl target) is still included into the build (ENABLE_PY2_MODULES flag is set for buster). Once we abandon buster and python2, this compat and ast.literal_eval could be cleaned up all through the code base. #### How to verify it run steps from the linked issue
…0224) #### Why I did it To fix #9643 #### How I did it Instead of ast.literal_eval added python2 compat code for json strings unicode -> str convertion. We need python2 compatibility since py2 sonic config engine (buster/sonic_config_engine-1.0-py2-none-any.whl target) is still included into the build (ENABLE_PY2_MODULES flag is set for buster). Once we abandon buster and python2, this compat and ast.literal_eval could be cleaned up all through the code base. #### How to verify it run steps from the linked issue
…nic-net#10224) Signed-off-by: Sangita Maity <samaity@linkedin.com> To fix sonic-net#9643 Instead of ast.literal_eval added python2 compat code for json strings unicode -> str convertion. We need python2 compatibility since py2 sonic config engine (buster/sonic_config_engine-1.0-py2-none-any.whl target) is still included into the build (ENABLE_PY2_MODULES flag is set for buster). Once we abandon buster and python2, this compat and ast.literal_eval could be cleaned up all through the code base. run steps from the linked issue
Description
If the platform.json file includes some fields with a boolean type value, an error occurred while parsing platform.json during
config-setup factory
.Steps to reproduce the issue:
For example:
sudo rm -f /etc/sonic/config_db.json
sudo config-setup factory
Note:
platform.json file must include an "interfaces" key with real interfaces inside, which describes all info about them.
For example:
If the "interfaces" key is empty, then the portconfig.py script will be use port_config.ini instead of platform.json to configure config_db.json file.
Describe the results you received:
Error logs:
Was received empty /etc/sonic/config_db.json file with a string:
error occurred while parsing json: malformed node or string: <ast.Name object at 0x7f041464b9a0>
Describe the results you expected:
/etc/sonic/config_db.json file with a description of interfaces.
Output of
show version
:Output of
show techsupport
:Additional information you deem important (e.g. issue happens only occasionally):
The text was updated successfully, but these errors were encountered: