Skip to content

Commit

Permalink
explicitly specify command with underscores (#846)
Browse files Browse the repository at this point in the history
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:

pallets/click#1123
  • Loading branch information
lguohan authored Mar 22, 2020
1 parent 07dc201 commit 780673c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion pfcwd/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 780673c

Please sign in to comment.