-
Notifications
You must be signed in to change notification settings - Fork 817
[CLI][show][platform] Added ASIC count in the output. #1185
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,11 +19,11 @@ | |
| import vlan | ||
| import system_health | ||
|
|
||
| from sonic_py_common import device_info | ||
| from sonic_py_common import device_info, multi_asic | ||
| from swsssdk import ConfigDBConnector, SonicV2Connector | ||
| from tabulate import tabulate | ||
| from utilities_common.db import Db | ||
| import utilities_common.multi_asic as multi_asic_util | ||
| import utilities_common.multi_asic as multi_asic_util | ||
|
|
||
|
|
||
| # Global Variables | ||
|
|
@@ -991,6 +991,7 @@ def get_hw_info_dict(): | |
| hw_info_dict['platform'] = device_info.get_platform() | ||
| hw_info_dict['hwsku'] = device_info.get_hwsku() | ||
| hw_info_dict['asic_type'] = version_info['asic_type'] | ||
| hw_info_dict['asic_count'] = multi_asic.get_num_asics() | ||
|
|
||
| return hw_info_dict | ||
|
|
||
|
|
@@ -1005,12 +1006,20 @@ def platform(): | |
|
|
||
| # 'summary' subcommand ("show platform summary") | ||
| @platform.command() | ||
| def summary(): | ||
| @click.option('--verbose', is_flag=True, help="Enable verbose output") | ||
| @click.option('--json', is_flag=True, help="JSON output") | ||
| def summary(verbose, json): | ||
| """Show hardware platform information""" | ||
|
|
||
| hw_info_dict = get_hw_info_dict() | ||
| click.echo("Platform: {}".format(hw_info_dict['platform'])) | ||
| click.echo("HwSKU: {}".format(hw_info_dict['hwsku'])) | ||
| click.echo("ASIC: {}".format(hw_info_dict['asic_type'])) | ||
| if json: | ||
| click.echo(hw_info_dict) | ||
| else: | ||
| click.echo("Platform: {}".format(hw_info_dict['platform'])) | ||
| click.echo("HwSKU: {}".format(hw_info_dict['hwsku'])) | ||
| click.echo("ASIC: {}".format(hw_info_dict['asic_type'])) | ||
| if verbose: | ||
| click.echo("ASIC Count: {}".format(hw_info_dict['asic_count'])) | ||
|
||
|
|
||
| # 'syseeprom' subcommand ("show platform syseeprom") | ||
| @platform.command() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.