arista_eos_show_inventory: parse storage, modules, split tables#4
Merged
mjbear merged 5 commits intoJul 2, 2026
Conversation
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.
Owner
|
@surudhi Seems like some of the raw data is similar in overall structure. Thank you! |
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.
91ff7b5 to
c9dc58a
Compare
Author
Yeah sure, I've listed them below
|
7aef412
into
mjbear:arista_eos_sh_inv_error-directive
14 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
addition to networktocode#2323