]> git.puffer.fish Git - mirror/frr.git/commitdiff
isis-topo1: improve topology parser
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Thu, 26 Jul 2018 22:11:30 +0000 (19:11 -0300)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:14 +0000 (20:22 -0500)
Don't match header otherwise it will create an even bigger JSON output
than we need.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
tests/topotests/isis-topo1/test_isis_topo1.py

index 97d959ff067f7a8e1fd5ff753ef127903c34d256..a99691d32d1e99009a4944e62a6283c9a1094366 100644 (file)
@@ -341,6 +341,15 @@ def parse_topology(lines, level):
         item_match = re.match(
             r"([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+)", line)
         if item_match is not None:
+            # Skip header
+            if (item_match.group(1) == 'Vertex' and
+                item_match.group(2) == 'Type' and
+                item_match.group(3) == 'Metric' and
+                item_match.group(4) == 'Next-Hop' and
+                item_match.group(5) == 'Interface' and
+                item_match.group(6) == 'Parent'):
+                continue
+
             areas[area][level][ipv].append({
                 'vertex': item_match.group(1),
                 'type': item_match.group(2),