Skip to content

Commit

Permalink
Fixed config Asym PFC CLI. (#632)
Browse files Browse the repository at this point in the history
Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
  • Loading branch information
nazariig authored and lguohan committed Sep 17, 2019
1 parent 065414a commit c1c53f5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1327,14 +1327,17 @@ def pfc(ctx):
#

@pfc.command()
@click.argument('interface_name', metavar='<interface_name>', required=True)
@click.argument('status', type=click.Choice(['on', 'off']))
@click.pass_context
def asymmetric(ctx, status):
def asymmetric(ctx, interface_name, status):
"""Set asymmetric PFC configuration."""
config_db = ctx.obj["config_db"]
interface = ctx.obj["interface_name"]
if get_interface_naming_mode() == "alias":
interface_name = interface_alias_to_name(interface_name)
if interface_name is None:
ctx.fail("'interface_name' is None!")

run_command("pfc config asymmetric {0} {1}".format(status, interface))
run_command("pfc config asymmetric {0} {1}".format(status, interface_name))

#
# 'platform' group ('config platform ...')
Expand Down

0 comments on commit c1c53f5

Please sign in to comment.