Skip to content

Commit

Permalink
get_sw_ver_info(): Return early if show_sw_ver argument is False
Browse files Browse the repository at this point in the history
If get_sw_ver_info() argument show_sw_ver is False, there's no need to
obtain version numbers from the Internet to then discard then.

Reorder the argument check to return immediately.

Relates to issue tenstorrent/tt-smi#42.

Signed-off-by: Andreas Färber <[email protected]>
  • Loading branch information
afaerber committed Sep 14, 2024
1 parent 2a83468 commit e9f77c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tt_tools_common/utils_common/system_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ def get_sw_ver_info(show_sw_ver: bool, board_ids: str):
"Buda": "N/A",
"Metallium": "N/A",
}
if not show_sw_ver:
return sw_ver

version = {}
for board_id in board_ids:
url = "https://cereal.tenstorrent.com?SerialNumber=" + board_id
Expand Down Expand Up @@ -196,7 +199,4 @@ def get_sw_ver_info(show_sw_ver: bool, board_ids: str):
except requests.exceptions.RequestException:
version["Failed to fetch"] = "Something unexpected happened."

if show_sw_ver:
return version

return sw_ver
return version

0 comments on commit e9f77c4

Please sign in to comment.