-
Notifications
You must be signed in to change notification settings - Fork 691
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
Switchport mode update for 'show interfaces status' #3788
base: master
Are you sure you want to change the base?
Conversation
RCA: According to present design port was conisdered as "trunk" if its part of a VLAN, there was no handling to fetch the acutal mode from Redis DB regarding the configured switchport mode. Solution: Configured "switchport mode" is fetched from DB for all front panel ports and PortChannel interfaces. "Vlan" column in "show interface status" is displayed based on below considerations: 1. If interface is part of PortChannel - display PortChannel interface name [present behavior] 2. If "switchport mode" is configured on interface [Ethernet/PortChannel] - display configured mode [new behavior] 3. If "switchport mode" is NOT configured on interface but part of a VLAN [Ethernet/PortChannel] - display as "trunk" [present behavior]
/azp run |
The committers listed above are authorized under a signed CLA. |
Azure Pipelines successfully started running 1 pipeline(s). |
@wen587 @xwjiang-ms please review |
vlan_member_table = config_db.get_table('VLAN_MEMBER') | ||
|
||
vlan_member_keys = [] | ||
for _, key in vlan_member_table: |
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.
if vlan_member_table returned is dict, maybe it's better to use
vlan_member_keys = list(vlan_member_table.keys())
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.
@FengPan-Frank : Vlan Member table has two parts in the key - (VlanName, MemberInterfaceName) , in above code we are extracting the member interfaces , so using vlan_member_table.keys()
will not give the same result
Sample VLAN_MEMBER table :
{('Vlan100', 'PortChannel100'): {'tagging_mode': 'untagged'}, ('Vlan100', 'Ethernet16'): {'tagging_mode': 'tagged'}}
Could we add some ut for the new support? |
What I did
Fixed "show interfaces status" output for interfaces with switchport mode configuration.
How I did it
Configured "switchport mode" is fetched from DB for all front panel ports and PortChannel interfaces.
"Vlan" column in "show interface status" is displayed based on below considerations:
How to verify it
Configure "switchport mode" for an interface/portchannel and verify the output in below show commands
Previous command output (if the output of a command-line utility has changed)
Previously it was always displaying as
trunk
even if interface is configured asaccess
New command output (if the output of a command-line utility has changed)
closes #3787