Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sfputil] Gracefully handle improper 'specification_compliance' field #1741

Merged
merged 1 commit into from
Aug 20, 2021

Conversation

prgeor
Copy link
Contributor

@prgeor prgeor commented Aug 4, 2021

Signed-off-by: Prince George [email protected]

What I did

Gracefully handle improper 'specification_compliance' field

How I did it

The 'specification_compliance' field of transceiver info is expected to be a string representation of a dictionary. However, there is a chance, upon some kind of platform issue that a vendor's platform API returns something like 'N/A'. In this case, sfpshow would crash. Rather than crash, sfpshow should handle this gracefully and output 'N/A' instead.

How to verify it

Run "sfputil show eeprom -d" on a device where the 'specification_compliance' field of transceiver info is not a string representation of a dictionary.

Previous command output (if the output of a command-line utility has changed)

N/A -- sfputil would crash

New command output (if the output of a command-line utility has changed)

Ethernet0: SFP EEPROM detected
Application Advertisement: N/A
Connector: N/A
Encoding: N/A
Extended Identifier: N/A
Extended RateSelect Compliance: N/A
Identifier: N/A
N/A: N/A
Nominal Bit Rate(100Mbs): N/A
Specification compliance:
N/A
Vendor Date Code(YYYY-MM-DD Lot): N/A
Vendor Name: N/A
Vendor OUI: N/A
Vendor PN: N/A
Vendor Rev: N/A
Vendor SN: N/A

@prgeor
Copy link
Contributor Author

prgeor commented Aug 10, 2021

@lguohan can this be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants