Skip to content

hp_procurve_show_lldp_info_local-device: new template#2313

Open
julmanglano wants to merge 2 commits into
networktocode:masterfrom
julmanglano:pr/hp-procurve-show-lldp-info-local-device
Open

hp_procurve_show_lldp_info_local-device: new template#2313
julmanglano wants to merge 2 commits into
networktocode:masterfrom
julmanglano:pr/hp-procurve-show-lldp-info-local-device

Conversation

@julmanglano
Copy link
Copy Markdown
Contributor

ISSUE TYPE
  • New Template Pull Request
COMPONENT

hp_procurve, show lldp info local-device

SUMMARY

Adds a new template for the HP/Aruba ProCurve show lldp info local-device command. Captures the device's own LLDP advertisement —
chassis info, system name/description, capabilities, and management
address.

Capture groups (cross-vendor aligned with other LLDP templates):
CHASSIS_TYPE, CHASSIS_ID, SYSTEM_NAME, SYSTEM_DESCRIPTION, MODEL,
CAPABILITIES_SUPPORTED, CAPABILITIES_ENABLED, MGMT_ADDRESS_TYPE,
MGMT_ADDRESS.

SYSTEM_DESCRIPTION has two fallback rules: when the description
starts with the vendor token (ProCurve|HP|Aruba), the part-number
is captured separately into MODEL; otherwise the whole string is
captured into SYSTEM_DESCRIPTION.

CHASSIS_ID is anchored on \S.*\S rather than \S+ because
ProCurve emits the chassis MAC in two different formats depending on
firmware:

  • compact dash-separated: 548028-aabbcf (stack/newer firmware)
  • space-separated bytes: 54 80 28 aa bb cd (standalone/older firmware)

The two fixtures cover both formats.

The LLDP Port Information section is acknowledged but not parsed
into capture groups (it would duplicate show lldp info remote-device
output — out of scope here).

Index entry inserted at the correct length-sorted position within the
hp_procurve block (length 47, between length-48 and length-45 rows).

Copy link
Copy Markdown
Contributor

@matt852 matt852 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommendation: Changes Suggested

Thanks @julmanglano — clean PR with thoughtful test data covering both chassis-ID formats. One cross-vendor alignment suggestion before merge:

Rename CAPABILITIES_ENABLEDCAPABILITIES. The dominant LLDP/CDP convention across Cisco, Arista, Aruba AOS-CX, Brocade, Huawei, and the existing hp_procurve_show_lldp_info_remote-device_detail.textfsm is CAPABILITIES_SUPPORTED paired with plain CAPABILITIES for the enabled set. Matching the sibling HP procurve template specifically keeps the field name consistent within the same vendor.

In ntc_templates/templates/hp_procurve_show_lldp_info_local-device.textfsm, the Value declaration:

-Value CAPABILITIES_ENABLED (\S.*\S)
+Value CAPABILITIES (\S.*\S)

And the matching rule in the Start state:

-  ^\s*System\s+Capabilities\s+Enabled\s*:\s+${CAPABILITIES_ENABLED}\s*$$
+  ^\s*System\s+Capabilities\s+Enabled\s*:\s+${CAPABILITIES}\s*$$

And the fixture key. In tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device.yml:

-    capabilities_enabled: "bridge"
+    capabilities: "bridge"

Apply the same single-line key rename to tests/hp_procurve/show_lldp_info_local-device/show_lldp_info_local-device2.yml.

Thanks!

@matt852 matt852 assigned matt852 and unassigned matt852 May 11, 2026
@matt852 matt852 added the changes_requested Waiting on user to address feedback label May 11, 2026
…to CAPABILITIES for cross-template consistency
@julmanglano
Copy link
Copy Markdown
Contributor Author

Thanks @matt852 — agreed on the alignment with the sibling _remote-device_detail template. Renamed CAPABILITIES_ENABLEDCAPABILITIES in the template (Value declaration + Start-state rule) and both fixture YAMLs. Both parser tests still pass, meta tests all green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changes_requested Waiting on user to address feedback

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants