Fix issue 23323 ipv6 subinterface#25538
Closed
Sumalatha-G-ML wants to merge 1 commit intosonic-net:masterfrom
Closed
Fix issue 23323 ipv6 subinterface#25538Sumalatha-G-ML wants to merge 1 commit intosonic-net:masterfrom
Sumalatha-G-ML wants to merge 1 commit intosonic-net:masterfrom
Conversation
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
7d79ace to
5b37fac
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
5b37fac to
09412db
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Fix for IPv6 disabled subinterface exception in 'show interface Ethernet' command. Changes: - Updated sonic-mgmt-framework submodule to include fix for issue sonic-net#23323 - Added conditional check for 'addresses' field in show_interface.j2 template - Prevents jinja2.exceptions.UndefinedError when IPv6 is disabled Fixes: sonic-net#23323 Signed-off-by: Sumalatha G <sumalatha.g@xoriant.com>
09412db to
f67cd12
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Author
|
Opened a PR in sonic-net/sonic-mgmt-framework repo so closing it. |
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.
Why I did it
Fix for issue #23323 - The sonic-cli command show interface Ethernet throws a jinja2.exceptions.UndefinedError exception when IPv6 is disabled on a subinterface.
Root Cause: The Jinja2 template show_interface.j2 (line 80) doesn't check if the addresses field exists before accessing it. When IPv6 is disabled, the openconfig-if-ip:ipv6 object doesn't contain an addresses field, causing the exception.
Work item tracking
Microsoft ADO (number only):
How I did it
Updated the sonic-mgmt-framework submodule to include the fix that adds a conditional check for the addresses field in the show_interface.j2 template.
Change in sonic-mgmt-framework:
File: CLI/renderer/templates/show_interface.j2 (line 79)
Before: {% if subif["openconfig-if-ip:ipv6"] %}
After: {% if subif["openconfig-if-ip:ipv6"] and "addresses" in subif["openconfig-if-ip:ipv6"] %}
This ensures the template only attempts to access the addresses field when it exists.
How to verify it
Configure a subinterface with IPv6 disabled
Run sonic-cli command: show interface Ethernet
Verify the command executes without throwing jinja2.exceptions.UndefinedError
Verify the interface information is displayed correctly
Test scenarios:
✅ IPv6 disabled (no addresses field) - should work without errors
✅ IPv6 enabled (with addresses field) - should work as before
Which release branch to backport (provide reason below if selected)
202305
202311
202405
202411
202505
202511
Tested branch (Please provide the tested image version)
Branch: fix-issue-23323-ipv6-subinterface
Submodule commit: b927e10551318d389fe8a7f68f33aee59e9f0f7c
Description for the changelog
Fix Jinja2 template error in show interface Ethernet command when IPv6 is disabled on subinterface
Link to config_db schema for YANG module changes
N/A - No config_db schema changes
A picture of a cute animal (not mandatory but encouraged)
🐛 → ✅