-
Notifications
You must be signed in to change notification settings - Fork 710
[VLAN] Do not allow to delete a VLAN with members #1420
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
Merged
Merged
Conversation
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
@allas-nvidia please add to the description the error when such delete is aborted. |
rested this please |
@deran1980 please fix the conflicts and lets make sure it passes tests |
…o this VLAN. Signed-off-by: allas <[email protected]>
5688255
to
aa77492
Compare
@liat-grozovik Conflict is solved. VLAN tests checked and passed. |
retest this please |
liat-grozovik
approved these changes
Feb 18, 2021
retest this please |
anand-kumar-subramanian
pushed a commit
to anand-kumar-subramanian/sonic-utilities
that referenced
this pull request
Mar 2, 2021
…o this VLAN. (sonic-net#1420) - What I did In vlan.py , function del_vlan added validation if there is no members assigned to this VLAN. If there are members - the execution of this command is failed with error on the screen. - How I did it Added validation of the VLAN_MEMBER_CFG_TABLE with the key VLAN_ID. If there are entries with this VLAN_ID - print error: VLAN ID {} can not be removed. First remove all members assigned to this VLAN. User should remove all members assigned to this VLAN, and after that he can delete vlan. - How to verify it sudo config vlan add 200 sudo config vlan member add 200 Ethernet0 sudo config vlan del 200 In this case - you will see error as there are members assigned to this VLAN sudo config vlan member del 200 Ethernet0 sudo config vlan del 200 Will pass. Signed-off-by: allas <[email protected]>
yxieca
pushed a commit
that referenced
this pull request
Mar 3, 2021
…o this VLAN. (#1420) - What I did In vlan.py , function del_vlan added validation if there is no members assigned to this VLAN. If there are members - the execution of this command is failed with error on the screen. - How I did it Added validation of the VLAN_MEMBER_CFG_TABLE with the key VLAN_ID. If there are entries with this VLAN_ID - print error: VLAN ID {} can not be removed. First remove all members assigned to this VLAN. User should remove all members assigned to this VLAN, and after that he can delete vlan. - How to verify it sudo config vlan add 200 sudo config vlan member add 200 Ethernet0 sudo config vlan del 200 In this case - you will see error as there are members assigned to this VLAN sudo config vlan member del 200 Ethernet0 sudo config vlan del 200 Will pass. Signed-off-by: allas <[email protected]>
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.
Signed-off-by: allas [email protected]
What I did
In vlan.py , function del_vlan added validation if there is no members assigned to this VLAN. If there are members - the execution of this command is failed with error on the screen.
How I did it
Added validation of the VLAN_MEMBER_CFG_TABLE with the key VLAN_ID. If there are entries with this VLAN_ID - print error:
VLAN ID {} can not be removed. First remove all members assigned to this VLAN.
User should remove all members assigned to this VLAN, and after that he can delete vlan.
How to verify it
sudo config vlan add 200
sudo config vlan member add 200 Ethernet0
sudo config vlan del 200
In this case - you will see error as there are members assigned to this VLAN
sudo config vlan member del 200 Ethernet0
sudo config vlan del 200
Will pass.
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)