Add error directive to arista_eos show inventory#2323
Conversation
These states already had patterns that matched all lines, so no new patterns needed to be added to them.
Add error directive and patterns to Transceiver state to make parsing pass successfully.
|
Tested this against real Issues found1. but empty slots print only two: so they fall through to 2. The 3. 4. (non-fatal) Split Model/Description tables Minimal repro
(Remove the Suggested direction
Happy to share the full set of anonymized captures across the platform/version matrix if useful for building out the test fixtures. |
Exactly why I asked if you'd test. 😀
We'll want to match this
Yep, we'll want to add patterns for the storage.
Yep, we'll want to add patterns for the subcomponent section.
Rather than have the PID or DESCR broken on newer SKUs we can fix it in this PR. Good.
If there's raw output from one device that covers all these cases that would be suitable. Otherwise please provide the anonymized raw data for the unique ones that represent the four findings. @surudhi If you'd like to create a PR against my branch and submit me a PR (against my fork), I can include your updates into this branch/PR. Let me know if you're interested in this collaboration. Thank you! |
Validating the error-directive template against `show inventory` from
~143 in-service EOS switches fleet-wide (AMER/EMEA/APAC, ~80 distinct
model+version combinations across the 7010-7500 range, EOS 4.18-4.35)
surfaced several real-world layouts that fell through to Error or were
mis-parsed:
- Trailing whitespace on the "Rev" header line defeated its `$$` anchor
(the most common failure, 54 of the 143 captures).
- DESCR `(.+)` absorbed inter-column whitespace, so transceiver rows
with a blank Rev (third-party optics: FS, PROLABS, ...) were silently
mis-mapped (model/serial shifted into the wrong fields). Anchoring
DESCR to start non-whitespace (`\S.*`) fixes this without changing any
existing capture.
- "Not Present" transceiver slots (port + literal only).
- Storage device tables after the transceiver section, including the
wrapped "Size (GB)" sub-table, multi-device output, and the
per-supervisor "Supervisor N:" layout on modular systems.
- A second "System has N auxiliary transceiver slots" table following
the switched transceiver table (7280DR3A).
- 7130 "Subcomponent serial numbers" block in the chassis section.
- "System has N card slots" line-card/supervisor module table
(7500-series and 7060X6).
- Split Model/Description chassis tables on newer SKUs, which
previously mis-captured PID/DESCR.
Line-card and supervisor modules (card-slot section) are recorded
(DESCR=slot, PID=model, VID=HW, SN=serial). Subcomponent, storage,
"Not Present", and the chassis/line-card faceplate transceiver rows
("Arista Networks <chassis/linecard>" with no serial, e.g. fixed copper
ports) are consumed without records, keeping the row schema focused on
present pluggable inventory.
Add eight anonymized fixtures covering these layouts; all serial numbers
are replaced with length-preserving fakes.
@mjbear hi, I just opened mjbear#4 against your fork adding my changes to this template along with raw data + yaml files for the issues I encountered. |
Make the separator pattern repeating and more distinct to reduce the chances it accidentally matches an unintended line.
This line was effectively replaced by another contributor instead of changing this line. Removing it.
Reducing duplicate lines to keep test data viable, yet compact.
arista_eos_show_inventory: parse storage, modules, split tables
During review of PR #2322, it was identified the arista_eos_show_inventory did not have Error directives in its States.
This PR adds those Error directives and any patterns required for parsing to pass successfully against current test data.
I've asked @surudhi if she'd test the modified template against more Arista EOS output.