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

SFP-Refactor: Could not able to fetch get_transceiver_info() #224

Closed
aravindmani-1 opened this issue Oct 26, 2021 · 3 comments · Fixed by #225
Closed

SFP-Refactor: Could not able to fetch get_transceiver_info() #224

aravindmani-1 opened this issue Oct 26, 2021 · 3 comments · Fixed by #225
Assignees

Comments

@aravindmani-1
Copy link
Contributor

aravindmani-1 commented Oct 26, 2021

While trying to dump transceiver information for CMIS device, it crashes with following trace.
python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.

from sonic_platform.chassis import Chassis
c=Chassis()
c.get_sfp(1).get_transceiver_info()
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.9/dist-packages/sonic_platform_base/sonic_xcvr/sfp_optoe_base.py", line 24, in get_transceiver_info
return api.get_transceiver_info() if api is not None else None
File "/usr/local/lib/python3.9/dist-packages/sonic_platform_base/sonic_xcvr/api/public/cmis.py", line 23, in get_transceiver_info
admin_info = self.xcvr_eeprom.read(consts.ADMIN_INFO_FIELD)
File "/usr/local/lib/python3.9/dist-packages/sonic_platform_base/sonic_xcvr/xcvr_eeprom.py", line 28, in read
return field.decode(raw_data, **decoded_deps)
File "/usr/local/lib/python3.9/dist-packages/sonic_platform_base/sonic_xcvr/fields/xcvr_field.py", line 235, in decode
result[field.name] = field.decode(raw_data[offset - start: offset + field.get_size() - start],
File "/usr/local/lib/python3.9/dist-packages/sonic_platform_base/sonic_xcvr/fields/public/cmis.py", line 12, in decode
mult = 10 ** (len_mult - 1)
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

@aravindmani-1
Copy link
Contributor Author

len_mult field is returning None.

@prgeor
Copy link
Collaborator

prgeor commented Oct 26, 2021

@andywongarista can you please check this issue?

@prgeor prgeor self-assigned this Oct 26, 2021
@andywongarista
Copy link
Contributor

I'll look into this.

oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-platform-common that referenced this issue Oct 25, 2024
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 a pull request may close this issue.

3 participants