From c6666e2bcf94cdca1f30d26d7e611f3db9f7e7cf Mon Sep 17 00:00:00 2001 From: Mykola F <37578614+mykolaf@users.noreply.github.com> Date: Sat, 2 Feb 2019 05:16:45 +0200 Subject: [PATCH] [intfutil] add Asymmetric PFC status to 'show interface status' (#437) Signed-off-by: Mykola Faryma --- scripts/intfutil | 6 ++++-- show/main.py | 23 ----------------------- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/scripts/intfutil b/scripts/intfutil index 3078f5c9a928..2e81e06fe223 100755 --- a/scripts/intfutil +++ b/scripts/intfutil @@ -21,6 +21,7 @@ PORT_SPEED = "speed" PORT_MTU_STATUS = "mtu" PORT_DESCRIPTION = "description" PORT_OPTICS_TYPE = "type" +PORT_PFC_ASYM_STATUS = "pfc_asym" def db_connect_appl(): @@ -84,7 +85,7 @@ def state_db_port_optics_get(state_db, intf_name, type): # ========================== interface-status logic ========================== -header_stat = ['Interface', 'Lanes', 'Speed', 'MTU', 'Alias', 'Oper', 'Admin', 'Type'] +header_stat = ['Interface', 'Lanes', 'Speed', 'MTU', 'Alias', 'Oper', 'Admin', 'Type', 'Asym PFC'] class IntfStatus(object): @@ -111,7 +112,8 @@ class IntfStatus(object): appl_db_port_status_get(self.appl_db, key, PORT_ALIAS), appl_db_port_status_get(self.appl_db, key, PORT_OPER_STATUS), appl_db_port_status_get(self.appl_db, key, PORT_ADMIN_STATUS), - state_db_port_optics_get(self.state_db, key, PORT_OPTICS_TYPE))) + state_db_port_optics_get(self.state_db, key, PORT_OPTICS_TYPE), + appl_db_port_status_get(self.appl_db, key, PORT_PFC_ASYM_STATUS))) # Sorting and tabulating the result table. sorted_table = natsorted(table) diff --git a/show/main.py b/show/main.py index 3690c7fbb62e..47cc4b724813 100755 --- a/show/main.py +++ b/show/main.py @@ -746,29 +746,6 @@ def pwm_pg_shared(): command = 'watermarkstat -p -t pg_shared' run_command(command) -# -# 'pfc' group ### -# - -@interfaces.group(cls=AliasedGroup, default_if_no_args=False) -def pfc(): - """Show PFC information""" - pass - - -# -# 'pfc status' command ### -# - -@pfc.command() -@click.argument('interface', type=click.STRING, required=False) -def status(interface): - """Show PFC information""" - if interface is None: - interface = "" - - run_command("pfc show asymmetric {0}".format(interface)) - # # 'mac' command ("show mac ...")