From f51544a8d5b2a9558b425eb0ec61303c36e3f0de Mon Sep 17 00:00:00 2001 From: pra-moh <49077256+pra-moh@users.noreply.github.com> Date: Tue, 26 Nov 2019 14:10:09 -0800 Subject: [PATCH] [show] Add 'features' subcommand to display status for optional features (#712) --- show/main.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/show/main.py b/show/main.py index 7edbfa758e76..bb2556403334 100755 --- a/show/main.py +++ b/show/main.py @@ -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()