Add missing sys imports to psu_base and fan_drawer_base#343
Merged
gechiang merged 1 commit intosonic-net:masterfrom Jan 30, 2023
Merged
Add missing sys imports to psu_base and fan_drawer_base#343gechiang merged 1 commit intosonic-net:masterfrom
gechiang merged 1 commit intosonic-net:masterfrom
Conversation
dprital
added a commit
to dprital/sonic-buildimage
that referenced
this pull request
Jan 30, 2023
Update sonic-platform-common submodule pointer to include the following: * 01ef800 Add missing sys imports ([sonic-net#343](sonic-net/sonic-platform-common#343)) Signed-off-by: dprital <drorp@nvidia.com>
8 tasks
liat-grozovik
pushed a commit
to sonic-net/sonic-buildimage
that referenced
this pull request
Feb 1, 2023
Update sonic-platform-common submodule pointer to include the following: * 01ef800 Add missing sys imports ([#343](sonic-net/sonic-platform-common#343)) Signed-off-by: dprital <drorp@nvidia.com>
yxieca
pushed a commit
that referenced
this pull request
Feb 2, 2023
qiluo-msft
pushed a commit
that referenced
this pull request
Feb 2, 2023
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
Import
sysin modules where it was missing and attempted to be referenced. Found it missing in psu_base.py and fan_drawer_base.py.Motivation and Context
sys.stderr.writeis used in default API definitions within psu_base.py and fan_drawer_base.py. When an exception is caught within these APIs, they will throwNameError: name 'sys' is not definedwhen trying to use thesysmodule without first importing it. Issue was originally found for PSUs, but also exists within fan_drawer_base.How Has This Been Tested?
Test code demonstrating the issue and the fix after importing
sysAdditional Information (Optional)
This fix should go into all active branches, especially master, 202205, and 202012.