Skip to content

Fix alphanum transceiver Rev in arista eos sh inv#2322

Merged
mjbear merged 1 commit into
networktocode:masterfrom
surudhi:fix/arista-eos-inventory-alpha-rev
Jun 7, 2026
Merged

Fix alphanum transceiver Rev in arista eos sh inv#2322
mjbear merged 1 commit into
networktocode:masterfrom
surudhi:fix/arista-eos-inventory-alpha-rev

Conversation

@surudhi

@surudhi surudhi commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

What

arista_eos_show_inventory silently drops every transceiver whose hardware Rev is not purely numeric, and mis-parses rows whose serial is numeric. The Transceiver state records via the following where VID was defined numeric only.
^\s+${PORT}\s+${DESCR}\s+${PID}\s+${SN}\s+${VID} -> Record

  1. Dropped rows. Any pluggable with an alpha Rev (DACs, AOCs, and most optics — A, A3, A4) fails the record regex and is omitted entirely.
  2. Column shift. When the serial is numeric (e.g. Acacia DP04QSDD-..., serial 253255691), the greedy DESCR + numeric-only VID forced TextFSM to bind the serial as VID, shifting PID/SN/VID left by on column.

Fix

Broaden VID to (\S+). The greedy DESCR then back-tracks to leave the last three whitespace-separated tokens as PID/SN/VID, so alpha-rev rows record and columns align. Change is scoped to this template only.

Testing

  • Added fixture arista_eos_show_inventory2.{raw,yml} covering alpha-rev DAC, AOC, and optic rows plus the numeric-serial (Acacia) shift case.
  • Existing arista_eos_show_inventory and arista_eos_show_inventory1 fixtures still pass unchanged (their revs are numeric).

@mjbear

mjbear commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

arista_eos_show_inventory silently drops every transceiver whose hardware Rev is not purely numeric, and mis-parses rows whose serial is numeric. The Transceiver state records via the following where VID was defined numeric only.

Hi @surudhi
Good catch. Thank you for the PR!

This template also doesn't have Error directives in the sections like it probably should. (Something probably there from before it was a project requirement.)

I suppose we keep this PR scoped to just the VID since adding in the Error directive part could be quite a few modifications.

If I take on a PR to add Error directives, would you be willing to test it on Arista gear? 🙂

@mjbear mjbear added the question label Jun 4, 2026
@surudhi

surudhi commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

arista_eos_show_inventory silently drops every transceiver whose hardware Rev is not purely numeric, and mis-parses rows whose serial is numeric. The Transceiver state records via the following where VID was defined numeric only.

Hi @surudhi Good catch. Thank you for the PR!

This template also doesn't have Error directives in the sections like it probably should. (Something probably there from before it was a project requirement.)

I suppose we keep this PR scoped to just the VID since adding in the Error directive part could be quite a few modifications.

If I take on a PR to add Error directives, would you be willing to test it on Arista gear? 🙂

Thanks @mjbear ! Agreed on keeping this PR scoped to just the VID change and leave the Error directive work as a separate effort.

And yes, I'm glad to test an Error-directive PR on Arista gear. I've got show inventory access across a good spread of EOS hardware.

@mjbear mjbear removed the question label Jun 7, 2026
@mjbear mjbear changed the title arista_eos_show_inventory: capture transceivers with alphanumeric Rev Fix alphanum transceiver Rev in arista eos sh inv Jun 7, 2026
@mjbear mjbear merged commit 6961417 into networktocode:master Jun 7, 2026
14 checks passed
@surudhi surudhi deleted the fix/arista-eos-inventory-alpha-rev branch June 8, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants