Skip to content

Add str conversion for numeric xcvr info fields to xcvrd #200

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
Jul 19, 2021

Conversation

andywongarista
Copy link
Contributor

Description

Converted nominal_bit_rate and cable_length fields from the sfp transceiver info dict into str in post_port_sfp_info_to_db

Motivation and Context

The documentation for get_transceiver_info in SfpBase indicates that these field values should be integers. However, only string values can be passed into swsscommon.FieldValuePairs. Therefore, a string conversion is needed.

How Has This Been Tested?

Tested on an Arista platform that xcvrd runs without errors when nominal_bit_rate and cable_length are integers.

Additional Information (Optional)

@lguohan lguohan requested a review from prgeor July 13, 2021 20:42
@lguohan
Copy link
Contributor

lguohan commented Jul 13, 2021

is this a bug fix?

@andywongarista
Copy link
Contributor Author

is this a bug fix?

Yes. I believe it's gone unnoticed because most platforms end up returning these fields as string (rather than int) and the tests don't verify the types of these fields.

@lguohan lguohan merged commit 53e1532 into sonic-net:master Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants