[sonic-py-common] Added an API to get file path containing SONiC version#6309
[sonic-py-common] Added an API to get file path containing SONiC version#6309smaheshm merged 2 commits intosonic-net:masterfrom
Conversation
|
The new |
It will be used in 'sonic-utilities/config'. sonic-net/sonic-utilities#1266 checkout config/main.py. |
|
retest mellanox please |
|
retest vsimage please |
|
retest mellanox please |
|
|
||
| def get_sonic_version_file(): | ||
| if not os.path.isfile(SONIC_VERSION_YAML_PATH): | ||
| return None |
There was a problem hiding this comment.
Does all the current callers of this API, handle a return value of "None" ? If this is a mandatory file, we could raise an exception.
There was a problem hiding this comment.
There is only one caller (sonic-net/sonic-utilities#1266). I'd say let's leave it to the caller to decide. Python will raise exception anyway.
|
retest mellanox please |
…ion (#6309) * [sonic-py-common] add an API to get file path containing SONiC version so that the API can be mocked for unit tests.
- Why I did it
Added an API to get the file path containing SONiC version so that the API can be mocked during unit tests.
- How I did it
Added the API.
- How to verify it
Manual verification.
- Which release branch to backport (provide reason below if selected)
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)