Skip to content

Add aruba aoscx show system inventory - #2339

Open
Ardeck wants to merge 8 commits into
networktocode:masterfrom
Ardeck:feat/aruba_aoscx_show_system_inventory
Open

Add aruba aoscx show system inventory#2339
Ardeck wants to merge 8 commits into
networktocode:masterfrom
Ardeck:feat/aruba_aoscx_show_system_inventory

Conversation

@Ardeck

@Ardeck Ardeck commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a new TextFSM template to support parsing show system inventory for Aruba AOS-CX devices.

Files Added / Modified

  • ntc_templates/templates/aruba_aoscx_show_system_inventory.textfsm
  • ntc_templates/templates/index
  • tests/aruba_aoscx/show_system_inventory/aruba_aoscx_show_system_inventory.raw
  • tests/aruba_aoscx/show_system_inventory/aruba_aoscx_show_system_inventory.yml

Example CLI Output

Type                 Location Product          Description                                        Serial           Hardware
                     Number   Number                                                                               Version
-------------------- -------- ---------------- -------------------------------------------------- ---------------- -----------
Chassis              1        JL635A           Aruba 8325-48Y8C 48p 25G 8p 100G Swch               TW52KM007J       0

Parsed Data Structure

[
  {
    "type": "Chassis",
    "location": "1",
    "product_number": "JL635A",
    "description": "Aruba 8325-48Y8C 48p 25G 8p 100G Swch",
    "serial": "TW52KM007J",
    "hardware_version": "0"
  }
]

Verification

  • Generated YAML test files (invoke gen-yaml-folder)
  • Tested with poetry run pytest -k aruba_aoscx_show_system_inventory (All tests pass)
  • Passed style and quality checks (invoke yamllint black flake8)

Anonymous and others added 3 commits July 30, 2026 12:15
* There is leading whitespace before Number, so make it one or more
* Modify table separator line regex to simplify
Comment thread tests/aruba_aoscx/show_system_inventory/aruba_aoscx_show_system_inventory.yml Outdated
mjbear added 2 commits July 30, 2026 19:33
* Remove regex space at beginning of line (not present in data)
* Fix two word part types (ex: Power Supply)
@mjbear mjbear added the WIP Work in Progress label Jul 30, 2026
@mjbear mjbear changed the title Feat/aruba aoscx show system inventory Add aruba aoscx show system inventory Jul 30, 2026
@mjbear mjbear removed the WIP Work in Progress label Jul 30, 2026
@mjbear

mjbear commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

@Ardeck
It's worth testing this aoscx sh sys inv template on more live gear after my changes.
Thank you!

@matt852 matt852 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Recommendation: Changes Suggested

Breaking Change: No

Thanks @Ardeck — this is in great shape: clean fixture pair, index entry, and all tests pass locally. One naming suggestion before merge:

  • Use PID instead of PRODUCT_NUMBER. docs/dev/data_model.md standardizes PID for part numbers / SKUs, and all seven existing *_show_inventory templates (arista_eos, aruba_os, cisco_asa, cisco_ios, cisco_nxos, cisco_wlc_ssh, cisco_xr_admin) use it — PRODUCT_NUMBER would be unique to this template.

    In ntc_templates/templates/aruba_aoscx_show_system_inventory.textfsm, the Value declaration:

    -Value PRODUCT_NUMBER (\S+)
    +Value PID (\S+)

    And the matching rule in the Start state:

    -  ^${TYPE}\s+${LOCATION}\s+${PRODUCT_NUMBER}\s+${DESCRIPTION}\s+${SERIAL}\s+${HARDWARE_VERSION}\s*$$ -> Record
    +  ^${TYPE}\s+${LOCATION}\s+${PID}\s+${DESCRIPTION}\s+${SERIAL}\s+${HARDWARE_VERSION}\s*$$ -> Record

    And in the fixture:

    -    product_number: "JL635A"
    +    pid: "JL635A"

    Apply the same key rename to every other product_number: line in the fixture — invoke gen-yaml-folder followed by invoke clean-yaml-folder regenerates it for you.

FYI / optional:

  • Value TYPE (\w+\s?\w+) is tighter than the output may allow. It accepts only one or two \w words, so a hyphenated type (Fan-Tray) raises LINE NOT FOUND and a three-word type (Power Supply Shelf) lands in the wrong columns. Since the Type and Location columns are always separated by two or more spaces, a greedy single-space repetition is safe and handles both:

    -Value TYPE (\w+\s?\w+)
    +Value TYPE (\S+(?:\s\S+)*)

    This leaves the current fixture output unchanged. Given @mjbear's note about testing on more live gear, it may be worth folding in now.

  • Bare -> Error is the prevailing convention in aruba_aoscx_* templates (25 bare vs. 2 with a message string):

    -  ^. -> Error "LINE NOT FOUND"
    +  ^. -> Error
  • TYPE and HARDWARE_VERSION differ from the sibling inventory templates' NAME and VID. Neither pair is standardized in docs/dev/data_model.md, and both of your names match the device's own column labels, so this is a maintainer call rather than a change request.

Thanks!
(review generated with Claude)

@mjbear

mjbear commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator
  • Value TYPE (\w+\s?\w+) is tighter than the output may allow. It accepts only one or two \w words, so a hyphenated type (Fan-Tray) raises LINE NOT FOUND and a three-word type (Power Supply Shelf) lands in the wrong columns. Since the Type and Location columns are always separated by two or more spaces, a greedy single-space repetition is safe and handles both:

There isn't an instance of either of these types (Fan-Tray nor Power Supply Shelf) in the test data. This suggestion by Claude AI may not be realistic.

@mjbear mjbear added the changes_requested Waiting on user to address feedback label Jul 31, 2026
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 question

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants