diff --git a/config/main.py b/config/main.py index 6fcc0f46f8..551e2d62d5 100755 --- a/config/main.py +++ b/config/main.py @@ -2166,6 +2166,23 @@ def delete(ctx): sflow_tbl['global'].pop('agent_id') config_db.set_entry('SFLOW', 'global', sflow_tbl['global']) +# +# 'feature' command ('config feature name state') +# +@config.command('feature') +@click.argument('name', metavar='', required=True) +@click.argument('state', metavar='', required=True, type=click.Choice(["enabled", "disabled"])) +def feature_status(name, state): + """ Configure status of feature""" + config_db = ConfigDBConnector() + config_db.connect() + status_data = config_db.get_entry('FEATURE', name) + + if not status_data: + click.echo(" Feature '{}' doesn't exist".format(name)) + return + + config_db.mod_entry('FEATURE', name, {'status': state}) if __name__ == '__main__': config()