From 37225a446f2998e9f0ce285d55d59265ac0557fc Mon Sep 17 00:00:00 2001 From: Marat Gubaiev <92568699+MaratGubaiev@users.noreply.github.com> Date: Fri, 18 Feb 2022 02:51:38 +0200 Subject: [PATCH] check for adding default vlan attempt added (#2075) *CLI throws an error specifying the user that Vlan 1 is default VLAN. Fix Orchagent crash. --- config/vlan.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/vlan.py b/config/vlan.py index 9cdb0fc348ac..80b4ff49849b 100644 --- a/config/vlan.py +++ b/config/vlan.py @@ -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))