From 4b8cee600ff9bf5fc252c3b95f772053e135ea91 Mon Sep 17 00:00:00 2001 From: Andrey Vertiprahov Date: Sun, 28 Feb 2021 00:05:02 +0500 Subject: [PATCH] Juniper.JunOS. Fix ConfDB normalizer for vlan_id 'none'. --- .../Juniper/JUNOS/confdb/normalizer.py | 3 ++- .../profiles/Juniper/JUNOS/vlans_none1.yml | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tests/confdb/profiles/Juniper/JUNOS/vlans_none1.yml diff --git a/sa/profiles/Juniper/JUNOS/confdb/normalizer.py b/sa/profiles/Juniper/JUNOS/confdb/normalizer.py index 707df742f3..df2599933c 100644 --- a/sa/profiles/Juniper/JUNOS/confdb/normalizer.py +++ b/sa/profiles/Juniper/JUNOS/confdb/normalizer.py @@ -37,7 +37,8 @@ class JunOSNormalizer(BaseNormalizer): @match("vlans", ANY, "vlan-id", ANY) def normalize_vlan_name(self, tokens): - yield self.make_vlan_name(vlan_id=tokens[3], name=tokens[1]) + if tokens[3] != "none": + yield self.make_vlan_name(vlan_id=tokens[3], name=tokens[1]) # @match("vlans", ANY, "description", REST) # def normalize_vlan_description(self, tokens): diff --git a/tests/confdb/profiles/Juniper/JUNOS/vlans_none1.yml b/tests/confdb/profiles/Juniper/JUNOS/vlans_none1.yml new file mode 100644 index 0000000000..90a4cb2b87 --- /dev/null +++ b/tests/confdb/profiles/Juniper/JUNOS/vlans_none1.yml @@ -0,0 +1,20 @@ +config: | + vlans { + v22 { + description MPLS_Managment; + vlan-id 22; + l3-interface irb.22; + } + v998 { + vlan-id none; + interface xe-0/0/2.4034; + l3-interface irb.998; + forwarding-options { + filter { + output OUTPUT-ACCESS_FILTER; + } + } + } + } +result: + - ["virtual-router", "default", "forwarding-instance", "default", "vlans", 22, "name", "v22", {'replace': True}] -- GitLab