Add ZTE BGP VRF summary aux FIB collect with optional all-VRF expand.

Wire config_vrf plus ipv4/ipv6 forwarding as aux for VPN VRF summaries, and allow unbound items to expand all AF-filtered VRFs at collect time.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-21 17:23:34 +08:00
parent 78f7032d7b
commit 3576e4a69c
9 changed files with 390 additions and 18 deletions

View file

@ -148,10 +148,25 @@ def discover_params(
candidates = []
seen: set[str] = set()
filt_field = ""
filt_contains = ""
if collect_profile_id:
collect = get_profile(collect_profile_id)
if collect:
for ph in collect.placeholders:
if placeholder and ph.name != placeholder:
continue
filt_field = str(ph.discover_filter_field or "").strip()
filt_contains = str(ph.discover_filter_contains or "").strip().lower()
break
for rec in records:
val = str(rec.get(value_field) or "").strip()
if not val or val in seen:
continue
if filt_field and filt_contains:
hay = str(rec.get(filt_field) or "").strip().lower()
if filt_contains not in hay:
continue
seen.add(val)
label = str(rec.get(label_field) or val).strip() or val
candidates.append(
@ -159,7 +174,7 @@ def discover_params(
"value": val,
"label": label,
"rd": str(rec.get("rd") or ""),
"protocols": str(rec.get("protocols") or ""),
"protocols": str(rec.get("protocols") or rec.get("address_families") or ""),
"extra": rec,
}
)