Skip to content

Commit

Permalink
[sonic-py-common] Added an API to get file path containing SONiC vers…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
smaheshm authored and lguohan committed Jan 3, 2021
1 parent 0ac81e3 commit 25b0f43
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/sonic-py-common/sonic_py_common/device_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,11 @@ def get_sonic_version_info():

return data

def get_sonic_version_file():
if not os.path.isfile(SONIC_VERSION_YAML_PATH):
return None

return SONIC_VERSION_YAML_PATH

#
# Multi-NPU functionality
Expand Down

0 comments on commit 25b0f43

Please sign in to comment.