mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 04:20:45 +08:00
Merge duplicate if-intf checks into Config Interface Intent.
Hide standalone IF VRF from the catalog and point ARP enrich at config_interface so one CLI maps to one check item. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
c1b1c0f75d
commit
1642a0adec
8 changed files with 37 additions and 21 deletions
|
|
@ -21,7 +21,7 @@ Cross-command (multi aux)
|
|||
1. Implement each aux as a normal status profile (steps 1–4)
|
||||
2. On the primary profile::
|
||||
|
||||
aux_commands=[AuxCommand(key="if_intf", profile_id="zte.if_intf")]
|
||||
aux_commands=[AuxCommand(key="if_intf", profile_id="zte.config_interface")]
|
||||
enrich_joins=[EnrichJoin(from_aux="if_intf", on="interface", take=("vrf",))]
|
||||
|
||||
3. CollectSession caches identical concrete CLI in one batch; enrich runs after
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""ZTE: show arp [| one-line].
|
||||
|
||||
Pipeline: TextFSM ``zte_zxros_show_arp`` → map → hand fallback.
|
||||
Cross-command VRF comes from profile ``enrich_joins`` (if_intf), not here.
|
||||
Cross-command VRF comes from profile ``enrich_joins`` (config_interface aux), not here.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
|
|
|||
|
|
@ -605,14 +605,14 @@ def _zte_status_profiles() -> list[ParseProfile]:
|
|||
command_template="show arp | one-line",
|
||||
match=r"(?i)^\s*show\s+arp(?:\s*\|\s*one-line)?\s*$",
|
||||
textfsm_command="show arp",
|
||||
description="ARP entries (IP/MAC/interface); VRF from if-intf aux.",
|
||||
description="ARP entries (IP/MAC/interface); VRF from config_interface aux.",
|
||||
fields=list(_ARP_FIELDS),
|
||||
tags=["arp", "l3", "status"],
|
||||
sort_order=320,
|
||||
enabled=True,
|
||||
kind="collect",
|
||||
aux_commands=[
|
||||
AuxCommand(key="if_intf", profile_id="zte.if_intf"),
|
||||
AuxCommand(key="if_intf", profile_id="zte.config_interface"),
|
||||
],
|
||||
enrich_joins=[
|
||||
EnrichJoin(from_aux="if_intf", on="interface", take=("vrf",)),
|
||||
|
|
@ -628,13 +628,13 @@ def _zte_status_profiles() -> list[ParseProfile]:
|
|||
match=r"(?i)^\s*show\s+running-config\s+if-intf\s*$",
|
||||
textfsm_command="show running-config if-intf",
|
||||
description=(
|
||||
"Interface VRF map for ARP enrich (aux). "
|
||||
"Free-form CLI match prefers zte.config_interface (longer regex)."
|
||||
"Compat/aux-only interface→VRF map (disabled in catalog). "
|
||||
"Use Config Interface Intent (zte.config_interface) instead."
|
||||
),
|
||||
fields=list(_IF_INTF_FIELDS),
|
||||
tags=["interface", "vrf", "config", "status", "aux"],
|
||||
sort_order=325,
|
||||
enabled=True,
|
||||
enabled=False,
|
||||
kind="collect",
|
||||
),
|
||||
ParseProfile(
|
||||
|
|
@ -1202,7 +1202,10 @@ def _zte_status_profiles() -> list[ParseProfile]:
|
|||
command_template="show running-config if-intf",
|
||||
match=r"(?i)^\s*show\s+running-config\s+if-intf(?:\s*\|\s*one-line)?\s*$",
|
||||
textfsm_command="show running-config if-intf",
|
||||
description="Interface VRF/IP/admin intent (richer than if_intf aux map).",
|
||||
description=(
|
||||
"Interface VRF/IP/admin intent; also ARP VRF enrich source "
|
||||
"(replaces standalone IF VRF / if_intf check)."
|
||||
),
|
||||
fields=list(_CONFIG_IFACE_FIELDS),
|
||||
tags=["config", "interface", "intent"],
|
||||
sort_order=510,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue