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.
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
[sonic-utilities][sonic-py-common] Move logic to get port config file path to sonic-py-common and update sonic-utilities to comply #5264
[sonic-utilities][sonic-py-common] Move logic to get port config file path to sonic-py-common and update sonic-utilities to comply #5264
Changes from 5 commits
c7a9f2f
9bf9aed
9b0ae79
ab2f8a3
d9c7acc
bd27d97
9841702
1a1c126
1b67ff8
e131ead
e18a0c7
e1d34d8
38a0bb8
2607b9f
db4149e
de5fda7
8988996
8047e8a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should be able to simplify this as follows, but will wait for input from @samaity and @SuvarnaMeenakshi in case recent changes have altered this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the above suggested simplification looks good. If asic is defined, then platform/hwsku/port_config.ini will not be present as per current design.
In the previous code, I do not see port_config_candidates.append(os.path.join(platform_path, PORT_CONFIG_INI)). being directly used, and is used only if hwsku is not defined. Any reason for removing that check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. Thanks for the confirmation!
Because
port_config.ini
has never resided directly under the<platform>
directory (unless something changed recently), as it has always been hardware SKU-specific. That's one of the reasons I'm asking these questions. I don't believe that is a valid check, and I want to confirm that it can be removed. @samaity: It appears you added this directory as a candidate. What was your reasoning?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jleveque , As I have understood till now and also during
platform.json
file porting, the order was like below.So, I followed the same, but yeah, I guess, I mistakenly added the directory. I don't think it's needed for
port_config.ini
. however,platform.json
will be under the platform directory. So we are safe with the changes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So to finalize/summarize for posterity,
platform.json
will always be found under:/usr/share/sonic/device/<platform>/
in the host OS/usr/share/sonic/platform/
inside a containerAnd
port_config.ini
will always be found under:/usr/share/sonic/device/<platform>/<hwsku>/<ASIC index>/
in the host OS of a multi-ASIC switch/usr/share/sonic/device/<platform>/<hwsku>/
in the host OS of a single-ASIC switch/usr/share/sonic/hwsku/<ASIC index>/
(also/usr/share/sonic/platform/<hwsku>/<ASIC index>/
) in a container on a multi-ASIC switch/usr/share/sonic/hwsku/
(also/usr/share/sonic/platform/<hwsku>/
) in a container on a single-ASIC switch@SuvarnaMeenakshi, @samaity: Correct?