Skip to content

[Backport] [202211] Fix issue: should always check return value of a function if the function may return None #355

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
Apr 13, 2023

Conversation

Junchao-Mellanox
Copy link
Contributor

@Junchao-Mellanox Junchao-Mellanox commented Mar 31, 2023

Backport #355 to 202211

Description

When a function may return None, caller should always check the return value before using it. This PR is to fix such issues in sonic-xcvr.

Motivation and Context

When a function may return None, caller should always check the return value before using it. This PR is to fix such issues in sonic-xcvr.

How Has This Been Tested?

Created unit test cases to avoid such thing happening

Additional Information (Optional)

…tion may return None (sonic-net#350)

Fix unit test failure
Conflicts:
	tests/sonic_xcvr/test_sff8436.py
	tests/sonic_xcvr/test_sff8472.py
	tests/sonic_xcvr/test_sff8636.py
@Junchao-Mellanox Junchao-Mellanox changed the title Fix issue: should always check return value of a function if the function may return None (#350) Fix unit test failure Conflicts: tests/sonic_xcvr/test_sff8436.py tests/sonic_xcvr/test_sff8472.py tests/sonic_xcvr/test_sff8636.py [Backport] [202211] Fix issue: should always check return value of a function if the function may return None Mar 31, 2023
@Junchao-Mellanox Junchao-Mellanox changed the base branch from master to 202211 March 31, 2023 09:48
@Junchao-Mellanox
Copy link
Contributor Author

/azpw run Azure.sonic-platform-common

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-platform-common

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liat-grozovik
Copy link
Collaborator

@prgeor could you please help to review and merge?

@prgeor
Copy link
Collaborator

prgeor commented Apr 10, 2023

@StormLiangMS to merge this for 202211

@StormLiangMS StormLiangMS merged commit a4ea689 into sonic-net:202211 Apr 13, 2023
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-platform-common that referenced this pull request Oct 25, 2024
…onic-net#355)

This change onboards refactor of various redis DB opens in y_cable_table-helper.py file and is required to onboard y_cable_async_client PR sonic-net#327

Basically it has changes for all the table to be now exclusively opened once per class instance .
It also accommodates refactor for getting async channels open given the params to open it.

Description
Motivation and Context
refactor ycabled

How Has This Been Tested?
UT and deploy changes on test DUT
Signed-off-by: vaibhav-dahiya <[email protected]>
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 this pull request may close these issues.

6 participants