Skip to content

Commit

Permalink
[show] Add 'features' subcommand to display status for optional featu…
Browse files Browse the repository at this point in the history
…res (sonic-net#712)
  • Loading branch information
pra-moh authored and jleveque committed Nov 26, 2019
1 parent dcf9520 commit f51544a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2389,5 +2389,21 @@ def tablelize(keys, data, enable_table_keys, prefix):
click.echo(tabulate(tablelize(keys, data, enable_table_keys, prefix), header))
state_db.close(state_db.STATE_DB)

#
# show features
#

@cli.command('features')
def features():
"""Show status of optional features"""
config_db = ConfigDBConnector()
config_db.connect()
header = ['Feature', 'Status']
body = []
status_data = config_db.get_table('FEATURE')
for key in status_data.keys():
body.append([key, status_data[key]['status']])
click.echo(tabulate(body, header))

if __name__ == '__main__':
cli()

0 comments on commit f51544a

Please sign in to comment.