Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.


return SONIC_VERSION_YAML_PATH

#
# Multi-NPU functionality
Expand Down