Skip to content

Commit

Permalink
check for adding default vlan attempt added (sonic-net#2075)
Browse files Browse the repository at this point in the history
*CLI throws an error specifying the user that Vlan 1 is default VLAN. Fix Orchagent crash.
  • Loading branch information
MaratGubaiev authored Feb 18, 2022
1 parent c65de65 commit 37225a4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/vlan.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ def add_vlan(db, vid):
ctx.fail("Invalid VLAN ID {} (1-4094)".format(vid))

vlan = 'Vlan{}'.format(vid)

if vid == 1:
ctx.fail("{} is default VLAN".format(vlan))

if clicommon.check_if_vlanid_exist(db.cfgdb, vlan):
ctx.fail("{} already exists".format(vlan))

Expand Down

0 comments on commit 37225a4

Please sign in to comment.