-
Notifications
You must be signed in to change notification settings - Fork 658
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 & CLI Modified Fix #3247
Conversation
Hi @theasianpianist , @prsunny @venkatmahalingam can you please help review this PR. |
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.
lgtm. Please check with other reviewer.
Hi All, Can you help with review this PR. Thanks. |
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.
Vlan changes lgtm
Hi @prsunny & @venkatmahalingam , can you please help with review. Thanks in advance, |
Can you please confirm there is no changes to existing 'show' commands? I see there is a new show CLI command which is ok. |
Please confirm, this issue is fixed in this PR - sonic-net/sonic-buildimage#18392 |
Hi @prsunny , we didn't make any change in exisiting show commands i.e in "show vlan brief" & "show int status". We proposed new show commands for switchport mode i.e "show int switchport config" & "show int switchport status" |
Yes, We have checked this change with latest build. Please see behavior |
Hi @wen587 Do you also suggest change for this PR in sonic_mgmt/gcu/test_vlan.py? |
@venkatmahalingam Hi Venkat, can you pls help review this PR. |
|
||
def vlan_range_list(ctx, vid_range: str) -> list: | ||
|
||
vid1, vid2 = map(int, vid_range.split("-")) |
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.
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.
Hi @qiluo-msft, this function is only called if "-" is present in the argument passed to the VLAN command. If there is no "-" character in the argument provided, then it will be considered as a comma-separated list instead, not as a range. This behavior can be seen in the multiple_vlan_parser() function defined on line 289 in utilities-common/cli.py
a4194c3
to
55ded95
Compare
Waiting on @prsunny approval. |
@@ -4639,19 +4645,38 @@ def add(ctx, interface_name, ip_addr, gw): | |||
if interface_name is None: | |||
ctx.fail("'interface_name' is None!") | |||
|
|||
# Add a validation to check this interface is not a member in vlan before | |||
# changing it to a router port | |||
vlan_member_table = config_db.get_table('VLAN_MEMBER') |
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.
Where is this checked now?
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.
We have added a check for switchport mode routed, a routed port fulfill this behavior that a interface has a vlan membership or not. So this check becomes redundant after addition of new check.
This PR is Fixture for sonic-net#3108 The PR was reverted due to backward compatibility issues. As per new suggestions, removed db migrator changes from this new change along with vlan.py & switchport.py changes To Fix issues as per suggestions removed default mode from YANG model and removed minigraph changes: 1. Removed Db migrator changes from code. 2. Modified Vlan.py & Switchport.py changes New commands have been added in Command-Reference.md All the syntax and examples have been added there and they can be verified by running the specific command
What I did
This PR is Fixture for #3108 The PR was reverted due to backward compatibility issues. As per new suggestions, removed db migrator changes from this new change along with vlan.py & switchport.py changes
To Fix issues as per suggestions removed default mode from YANG model and removed minigraph changes:
How I did it
How to verify it
New commands have been added in Command-Reference.md All the syntax and examples have been added there and they can be verified by running the specific command