Skip to content

Commit c1c53f5

Browse files
nazariiglguohan
authored andcommitted
Fixed config Asym PFC CLI. (#632)
Signed-off-by: Nazarii Hnydyn <[email protected]>
1 parent 065414a commit c1c53f5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

config/main.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -1327,14 +1327,17 @@ def pfc(ctx):
13271327
#
13281328

13291329
@pfc.command()
1330+
@click.argument('interface_name', metavar='<interface_name>', required=True)
13301331
@click.argument('status', type=click.Choice(['on', 'off']))
13311332
@click.pass_context
1332-
def asymmetric(ctx, status):
1333+
def asymmetric(ctx, interface_name, status):
13331334
"""Set asymmetric PFC configuration."""
1334-
config_db = ctx.obj["config_db"]
1335-
interface = ctx.obj["interface_name"]
1335+
if get_interface_naming_mode() == "alias":
1336+
interface_name = interface_alias_to_name(interface_name)
1337+
if interface_name is None:
1338+
ctx.fail("'interface_name' is None!")
13361339

1337-
run_command("pfc config asymmetric {0} {1}".format(status, interface))
1340+
run_command("pfc config asymmetric {0} {1}".format(status, interface_name))
13381341

13391342
#
13401343
# 'platform' group ('config platform ...')

0 commit comments

Comments
 (0)