Add aruba_aoscx show module#2319
Conversation
matt852
left a comment
There was a problem hiding this comment.
Recommendation: Changes Suggested
Thanks @julmanglano — this is in great shape, and the PR description's call-outs on the cross-vendor names are exactly right. Two suggestions before merge:
-
Rename
SERIAL_NUMBERtoSERIAL.docs/dev/data_model.mdstandardizes onSERIALfor serial numbers, and the two closest sibling templates (cisco_asa_show_module,cisco_ios_show_module) both useValue SERIAL.In
ntc_templates/templates/aruba_aoscx_show_module.textfsm, the Value declaration:-Value Required SERIAL_NUMBER (\S+) +Value Required SERIAL (\S+)
And the matching rule in the
Rowsstate:- ^${MODULE}\s+${MODEL}\s+${DESCRIPTION}\s{2,}${SERIAL_NUMBER}\s+${STATUS}\s*$$ -> Record + ^${MODULE}\s+${MODEL}\s+${DESCRIPTION}\s{2,}${SERIAL}\s+${STATUS}\s*$$ -> Record
Across both fixtures (
tests/aruba_aoscx/show_module/show_module.yml, 8 entries;show_module2.yml, 2 entries), rename everyserial_number:key toserial:. First entry as an example:- serial_number: "SG1ABCDEF1" + serial: "SG1ABCDEF1"
Apply the same single-line key rename to every other
serial_number:line in both fixture files. -
Rename
DESCRIPTIONtoCARDTYPE.cisco_asa_show_moduleandcisco_ios_show_moduleboth useCARDTYPEfor the per-module card description column;docs/dev/data_model.mdreservesDESCRIPTIONfor port/interface descriptions, which is a different semantic.In
ntc_templates/templates/aruba_aoscx_show_module.textfsm, the Value declaration:-Value DESCRIPTION (\S.*\S) +Value CARDTYPE (\S.*\S)
And the matching rule in the
Rowsstate:- ^${MODULE}\s+${MODEL}\s+${DESCRIPTION}\s{2,}${SERIAL_NUMBER}\s+${STATUS}\s*$$ -> Record + ^${MODULE}\s+${MODEL}\s+${CARDTYPE}\s{2,}${SERIAL_NUMBER}\s+${STATUS}\s*$$ -> Record
Across both fixtures (
show_module.yml, 8 entries;show_module2.yml, 2 entries), rename every leading- description:key to- cardtype:. First entry as an example:- - description: "6300M 24SFP+ 4SFP56 Swch" + - cardtype: "6300M 24SFP+ 4SFP56 Swch"
Apply the same key rename to every other
description:entry in both fixture files.
Thanks!
…MBER to SERIAL per data_model.md
|
Thanks @matt852 — applied both renames. |
* Since the captured data/columns in both sections were the same... * Reduce duplication * Reduce complexity from multiple state transitions
ISSUE TYPE
COMPONENT
aruba_aoscx,
show moduleSUMMARY
Adds a new template for the AOS-CX
show modulecommand. Theoutput is a per-module inventory of the chassis / VSF stack split
into two sections (
Management ModulesandLine Modules). Ona VSF stack each physical member appears once in each section, so
a 6-member stack produces 12 records.
CAPTURE GROUPS
MODULE_TYPE(Filldown) —ManagementorLine, taken fromthe section header.
MODULE(Required) — slot identifier (e.g.1/1).MODEL— HPE/Aruba product number (e.g.JL658A).DESCRIPTION— human-readable card description(e.g.
6300M 24SFP+ 4SFP56 Swch).SERIAL_NUMBER(Required) — module serial.STATUS— module state. Includes multi-word with parentheses(
Active (local)) on the live management module.CROSS-VENDOR ALIGNMENT
MODULE,MODEL,STATUS— already used byarista_eos_show_module,cisco_asa_show_module,cisco_ios_show_module.SERIAL_NUMBER— chosen over the existingSERIAL(cisco_asa, cisco_ios) andSERIAL_NUM(arista) tomatch the full-name convention from the contribution standards.
Open to renaming if reviewers prefer alignment with the older
templates instead.
DESCRIPTION— kept under the device's own column label(
Description). Cisco / Arista templates useCARDTYPEfor thesame concept. Open to renaming pre-merge.
MODULE_TYPE— AOS-CX-specific (ManagementvsLinesectionheader). No cross-vendor analog.
TEST DATA
Two fixtures:
show_module.{raw,yml}— 4-member VSF stack with Managementand Line sections (8 records). Exercises the multi-word /
parenthesised
Active (local)status on the live managementmodule.
show_module2.{raw,yml}— standalone (non-VSF) device. Singlemember appearing in both sections (2 records).
Index entry inserted within the
aruba_aoscxblock at thelength-19 position (after
show_interfacelength 22 and beforeshow_systemlength 19, sorted alphabetically within equal-lengthgroup).