Mock path early so it will applied to sonic_py_common, mock platform_chassis#188
Merged
qiluo-msft merged 1 commit intosonic-net:masterfrom May 24, 2021
Merged
Conversation
jleveque
approved these changes
May 24, 2021
andywongarista
pushed a commit
to andywongarista/sonic-platform-daemons
that referenced
this pull request
Jun 30, 2021
…chassis (sonic-net#188) #### Description Following sonic-net#187 to fix the same issue with other packages #### Motivation and Context This is blocking sonic-net/sonic-buildimage#7655 #### How Has This Been Tested? Unit test
vdahiya12
pushed a commit
to vdahiya12/sonic-platform-daemons
that referenced
this pull request
Apr 4, 2022
#### Description
xcvrd crashes with the following trace for few media when processing application advertisement.
```
Traceback (most recent call last):
File "/usr/local/bin/xcvrd", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd.py", line 1415, in main
xcvrd.run()
File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd.py", line 1363, in run
self.init()
File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd.py", line 1328, in init
post_port_sfp_dom_info_to_db(is_warm_start, self.stop_event)
File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd.py", line 501, in post_port_sfp_dom_info_to_db
post_port_sfp_info_to_db(logical_port_name, int_tbl[asic_index], transceiver_dict, stop_event)
File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd.py", line 293, in post_port_sfp_info_to_db
port_info_dict = _wrapper_get_transceiver_info(physical_port)
File "/usr/local/lib/python3.7/dist-packages/xcvrd/xcvrd.py", line 164, in _wrapper_get_transceiver_info
return platform_chassis.get_sfp(physical_port).get_transceiver_info()
File "/usr/local/lib/python3.7/dist-packages/sonic_platform/sfp.py", line 621, in get_transceiver_info
sfp_application_type_list[i * 4], sfp_application_type_list[i * 4 + 1])
File "/usr/local/lib/python3.7/dist-packages/sonic_platform_base/sonic_sfp/qsfp_dd.py", line 95, in parse_application
media_result = sfp_media_type_dict[media_interface]
KeyError: '88'
```
#### Motivation and Context
To fix the crash, check whether the media interface key is present before retrieving the particular key in the dict.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Following #187 to fix the same issue with other packages
Motivation and Context
This is blocking sonic-net/sonic-buildimage#7655
How Has This Been Tested?
Unit test
Additional Information (Optional)