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

Fix index out of range in the error log of invalid media lane mask re… #386

Merged
merged 1 commit into from
Jul 14, 2023

Conversation

MichaelWangSmci
Copy link
Contributor

…ceived

In the error log format string, there are 6 placeholders but only 5 values are provided.

Description

Add lport at the beginning of the values and remove the redundant lport in the format.
So there are 5 placeholders and 5 values.

Motivation and Context

There will be an IndexError exception like below.

Exception occured at CmisManagerTask thread due to IndexError('Replacement index 5 out of range for positional args tuple')
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/xcvrd/xcvrd.py", line 1878, in run
    self.task_worker()
  File "/usr/local/lib/python3.9/dist-packages/xcvrd/xcvrd.py", line 1672, in task_worker
    self.log_error("{}: Invalid media lane mask received - media_lane_count {} "
IndexError: Replacement index 5 out of range for positional args tuple
Xcvrd: exception found at child thread CmisManagerTask due to IndexError('Replacement index 5 out of range for positional args tuple')
Exiting main loop as child thread raised exception!

How Has This Been Tested?

Fake the error to check if the error log can be printed as expected.

CMIS: Ethernet162: Invalid media lane mask received - media_lane_count 1 media_lane_assignment_options 85 subport 0 appl 2!

Additional Information (Optional)

@MichaelWangSmci
Copy link
Contributor Author

MichaelWangSmci commented Jul 13, 2023

The pull request introduced this is #353.
And it is included in master, 202305, 202211 and 202205.

…ceived

Signed-off-by: Michael Wang <michaelwang@supermicro.com.tw>
@prgeor prgeor merged commit db6e340 into sonic-net:master Jul 14, 2023
4 checks passed
@MichaelWangSmci
Copy link
Contributor Author

Is it possible this pull request can be also merged into 202305, 202211 and 202205?

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.

2 participants