Skip to content

[sfpshow] Gracefully handle improper 'specification_compliance' field #1594

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

Merged
merged 1 commit into from
May 7, 2021
Merged

[sfpshow] Gracefully handle improper 'specification_compliance' field #1594

merged 1 commit into from
May 7, 2021

Conversation

jleveque
Copy link
Contributor

@jleveque jleveque commented May 6, 2021

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 sfpshow 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 -- sfpshow 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

Related PR: sonic-net/sonic-platform-daemons#169

@jleveque
Copy link
Contributor Author

jleveque commented May 6, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jleveque jleveque merged commit a71ff02 into sonic-net:master May 7, 2021
@jleveque jleveque deleted the handle_noncompliant_spec_comp branch May 7, 2021 01:00
daall pushed a commit that referenced this pull request May 7, 2021
…#1594)

#### 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.
gitsabari pushed a commit to gitsabari/sonic-utilities that referenced this pull request Jun 15, 2021
…sonic-net#1594)

#### 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.
prgeor pushed a commit to prgeor/sonic-utilities that referenced this pull request Jul 27, 2021
…sonic-net#1594)

Gracefully handle improper 'specification_compliance' field

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.
abdosi pushed a commit that referenced this pull request Aug 6, 2021
…#1594) (#1729)

Gracefully handle improper 'specification_compliance' field

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.

Co-authored-by: Joe LeVeque <[email protected]>
stepanblyschak pushed a commit to stepanblyschak/sonic-utilities that referenced this pull request Apr 28, 2022
97d9713 (HEAD -> 201911, origin/201911) [sfpshow] Gracefully handle improper 'specification_compliance' field (sonic-net#1594) (sonic-net#1729)
2099c73 [CLI] Implement null_route_helper script (sonic-net#1740)
b566591 [minigraph][port_config] Consume port_config.json while reloading minigraph (sonic-net#1725)
e840c42 Change the method name to align with master, reduce diverge issue (sonic-net#1703)

Signed-off-by: Abhishek Dosi <[email protected]>
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