From 9d20212e319e5bb8ef5d276c98d4b0d7f6b35d82 Mon Sep 17 00:00:00 2001 From: Tamer Ahmed Date: Sat, 11 Jul 2020 16:31:21 -0700 Subject: [PATCH] [filter-fdb] Fix For Vlan Defined With No CIDR (#976) VLAN_INTERFACE section in Config_db may contain entries with no CIDR. This fix skip those entries. signed-off-by: Tamer Ahmed --- scripts/filter_fdb_entries.py | 2 ++ sonic-utilities-tests/filter_fdb_input/test_vectors.py | 1 + 2 files changed, 3 insertions(+) diff --git a/scripts/filter_fdb_entries.py b/scripts/filter_fdb_entries.py index d7f93d3e1e..31d4204ec9 100755 --- a/scripts/filter_fdb_entries.py +++ b/scripts/filter_fdb_entries.py @@ -31,6 +31,8 @@ def get_vlan_cidr_map(filename): vlan_cidr = defaultdict() if "VLAN_INTERFACE" in config_db_entries.keys() and "VLAN" in config_db_entries.keys(): for vlan_key in config_db_entries["VLAN_INTERFACE"].keys(): + if '|' not in vlan_key: + continue vlan, cidr = tuple(vlan_key.split('|')) if vlan in config_db_entries["VLAN"]: vlan_cidr[vlan] = ip_interface(cidr).network diff --git a/sonic-utilities-tests/filter_fdb_input/test_vectors.py b/sonic-utilities-tests/filter_fdb_input/test_vectors.py index cd1592a0a4..2321da47af 100644 --- a/sonic-utilities-tests/filter_fdb_input/test_vectors.py +++ b/sonic-utilities-tests/filter_fdb_input/test_vectors.py @@ -198,6 +198,7 @@ "Vlan1000": {} }, "VLAN_INTERFACE": { + "Vlan1000": {}, "Vlan1000|192.168.128.1/21": {} }, },