-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[DPB][YANG] Fix cases when boolean is used in different literal cases #9418
[DPB][YANG] Fix cases when boolean is used in different literal cases #9418
Conversation
* Add boolean as typedef to sonic-types * Fix boolean in sonic-feature yang model * Fix boolean in sonic-flex_counter yang model Signed-off-by: Mykola Gerasymenko <[email protected]>
@qiluo-msft Please review. |
@mykolaxgerasymenko After the fix of this is done, the breakout fails due to the CRM yang model. I tried to accommodate the changes required. Post that, this is the error I am facing. root@localhost:~# config interface breakout Ethernet0 4x10G[25G] Running Breakout Mode : 1x100G[50G,40G,25G,10G] Ports to be deleted : After running Logic to limit the impact Final list of ports to be deleted : Can someone help me identity there is this str object? |
@tw0byt3 |
@mykolaxgerasymenko Yes, I fixed the boolean issue similar to what you have fixed in this PR. The CRM yang model is missing srv6_my_sid_entry_high_threshold, srv6_my_sid_entry_low_threshold, srv6_my_sid_entry_threshold_type, srv6_nexthop_high_threshold, srv6_nexthop_low_threshold, srv6_nexthop_threshold_type. |
"has_timer": "false", | ||
"has_global_scope": "False", | ||
"has_per_asic_scope": "True", | ||
"has_timer": "False", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added these changes with "False" and "True" with a capital letter to make it clear that this option can also be used and it is valid.
@mykolaxgerasymenko Any idea where can I find the 'str' object causing the above issue mentioned. |
@tw0byt3 I faced a similar issue log when was problem with comparing boolean type in sonic-flex_counter.yang. But I fixed it in this PR. After this fix the DPB feature worked correctly. |
@qiluo-msft please merge |
Could you solve the conflict? |
ba3613f
Conflict has been resolved. |
/AzurePipelines run Azure.sonic-buildimage |
Commenter does not have sufficient privileges for PR 9418 in repo Azure/sonic-buildimage |
Signed-off-by: Mykola Gerasymenko <[email protected]>
@qiluo-msft Could you please restart build CI? I do not have permissions. |
I triggered the build. As a PR owner, you can try |
Thank you. |
Please raise a new PR for 202111 branch, as this patch cannot be cleanly cherry-picked. |
…#9654) * Add boolean as typedef to sonic-types * Fix boolean in sonic-feature yang model * Fix boolean in sonic-flex_counter yang model #### Why I did it It was request to cherry-pick fix from master (#9418) to 202111 branch to fix issue when boolean is used in different literal cases. #### How I did it Added boolean to sonic-types as typedef with different literal cases. #### How to verify it Run the command config interface breakout <interface_name> <breakout_mode>
Signed-off-by: Mykola Gerasymenko [email protected]
Fixes #9326
Why I did it
When we try execute DPB from CLI we have error:
libyang[0]: Invalid value "False" in "has_global_scope" element. (path: /sonic-feature:sonic-feature/FEATURE/FEATURE_LIST[name='bgp']/has_global_scope)
The reason for this issue is that has_global_scope and other have been stored in redis database with value False or True form capital letter:
But yang model support boolean just in lowercase letters (https://datatracker.ietf.org/doc/html/rfc6020#section-9.5.1).
How I did it
Added boolean to sonic-types as typedef with different literal cases.
How to verify it
Run the command config interface breakout <breakout_mode>
NOTE:
To verify this fix, the following PRs that fix other problems in SONiC must be merged into master:
Which release branch to backport (provide reason below if selected)
Description for the changelog
A picture of a cute animal (not mandatory but encouraged)