From 6e3679b6f84475d748b31dca4f628ccdadeeba48 Mon Sep 17 00:00:00 2001 From: shlomibitton <60430976+shlomibitton@users.noreply.github.com> Date: Tue, 24 Mar 2020 14:32:09 +0200 Subject: [PATCH] Fix for adding L3 interface to Vlan group (#826) Signed-off-by: Shlomi Bitton --- config/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/main.py b/config/main.py index bb40a1901b5b..3a30756dd2e8 100755 --- a/config/main.py +++ b/config/main.py @@ -1065,6 +1065,7 @@ def add_vlan_member(ctx, vid, interface_name, untagged): db = ctx.obj['db'] vlan_name = 'Vlan{}'.format(vid) vlan = db.get_entry('VLAN', vlan_name) + interface_table = db.get_table('INTERFACE') if get_interface_naming_mode() == "alias": interface_name = interface_alias_to_name(interface_name) @@ -1084,6 +1085,10 @@ def add_vlan_member(ctx, vid, interface_name, untagged): else: ctx.fail("{} is already a member of {}".format(interface_name, vlan_name)) + for entry in interface_table: + if (interface_name == entry[0]): + ctx.fail("{} is a L3 interface!".format(interface_name)) + members.append(interface_name) vlan['members'] = members db.set_entry('VLAN', vlan_name, vlan)