Allow compare templates to split one collected metric into filtered sheets.

BGP/ISIS (and any other metric) can share a metric_id with distinct sheet_id + row_filters; drop conflicting bgp state_or_pfx and keep state/pfx_rcd.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-19 01:46:03 +08:00
parent 88b7558a48
commit a65c9fc420
17 changed files with 745 additions and 230 deletions

View file

@ -145,6 +145,12 @@ class ZteStatusParserTests(unittest.TestCase):
conn = [r for r in rows if r["state"] == "Connect"]
self.assertGreaterEqual(len(est), 3)
self.assertGreaterEqual(len(conn), 3)
self.assertTrue(all("state_or_pfx" not in r for r in rows))
self.assertTrue(all(r["pfx_rcd"].isdigit() for r in est))
self.assertTrue(all(r["pfx_rcd"] == "" for r in conn))
one = next(r for r in rows if r["neighbor"] == "10.206.63.205")
self.assertEqual(one["state"], "Established")
self.assertEqual(one["pfx_rcd"], "642")
ipv4 = _section(self.log, "show bgp ipv4 unicast summary", ("show bgp vpnv6",))
rows2 = normalize_bgp_peer(raw_text=ipv4, command="show bgp ipv4 unicast summary")