From 780673c22c80bc1ba383cf1a4fcc7844d2d33c08 Mon Sep 17 00:00:00 2001 From: lguohan Date: Sat, 21 Mar 2020 18:18:53 -0700 Subject: [PATCH] explicitly specify command with underscores (#846) Starting click 7.0. The default behavior of a command with under scores will be replace with dashes. this is to address the above default behavior change, so that the command remains the same. more details can be found: https://github.com/pallets/click/issues/1123 --- config/main.py | 4 ++-- pfcwd/main.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/main.py b/config/main.py index f987c8774db9..820d4085e690 100755 --- a/config/main.py +++ b/config/main.py @@ -641,7 +641,7 @@ def reload(filename, yes, load_sysinfo): log_info("'reload' restarting services...") _restart_services() -@config.command() +@config.command("load_mgmt_config") @click.option('-y', '--yes', is_flag=True, callback=_abort_if_false, expose_value=False, prompt='Reload mgmt config?') @click.argument('filename', default='/etc/sonic/device_desc.xml', type=click.Path(exists=True)) @@ -665,7 +665,7 @@ def load_mgmt_config(filename): run_command(command, display_cmd=True, ignore_error=True) click.echo("Please note loaded setting will be lost after system reboot. To preserve setting, run `config save`.") -@config.command() +@config.command("load_minigraph") @click.option('-y', '--yes', is_flag=True, callback=_abort_if_false, expose_value=False, prompt='Reload config from minigraph?') def load_minigraph(): diff --git a/pfcwd/main.py b/pfcwd/main.py index 880a5f33f8ac..3a27e993a863 100644 --- a/pfcwd/main.py +++ b/pfcwd/main.py @@ -221,7 +221,7 @@ def stop(ports): configdb.mod_entry(CONFIG_DB_PFC_WD_TABLE_NAME, port, None) # Set WD default configuration on server facing ports when enable flag is on -@cli.command() +@cli.command("start_default") def start_default(): """ Start PFC WD by default configurations """ if os.geteuid() != 0: