From 777611fc0bc7b46bbaf80e32815e6d2766dac543 Mon Sep 17 00:00:00 2001 From: Vaibhav Dahiya Date: Mon, 9 Sep 2024 23:52:23 +0000 Subject: [PATCH] add cosmetic fix Signed-off-by: Vaibhav Dahiya --- show/interfaces/__init__.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/show/interfaces/__init__.py b/show/interfaces/__init__.py index 7c7010e645..6f793e6803 100644 --- a/show/interfaces/__init__.py +++ b/show/interfaces/__init__.py @@ -680,18 +680,17 @@ def fetch_fec_histogram(port_oid_map, target_port): asic_db_kvp = counter_db.get_all(counter_db.COUNTERS_DB, 'COUNTERS:{}'.format(port_oid)) if asic_db_kvp is not None: - fec_errors = {f'BIN{i}': asic_db_kvp.get(f'SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_S{i}', '0') for i in range(16)} - - # Prepare the data for tabulation - table_data = [(bin_label, error_value) for bin_label, error_value in fec_errors.items()] - - # Define headers - headers = ["Symbol Errors Per Codeword", "Codewords"] - - # Print FEC histogram using tabulate - click.echo(tabulate(table_data, headers=headers, tablefmt="plain")) - - + fec_errors = {f'BIN{i}': asic_db_kvp.get + (f'SAI_PORT_STAT_IF_IN_FEC_CODEWORD_ERRORS_S{i}', '0') for i in range(16)} + + # Prepare the data for tabulation + table_data = [(bin_label, error_value) for bin_label, error_value in fec_errors.items()] + + # Define headers + headers = ["Symbol Errors Per Codeword", "Codewords"] + + # Print FEC histogram using tabulate + click.echo(tabulate(table_data, headers=headers)) else: click.echo('No kvp found in ASIC DB for port {}, exiting'.format(target_port), err=True) raise click.Abort()