Skip to content

Commit

Permalink
add cosmetic fix
Browse files Browse the repository at this point in the history
Signed-off-by: Vaibhav Dahiya <vdahiya@microsoft.com>
  • Loading branch information
vdahiya12 committed Sep 9, 2024
1 parent 59490ed commit 777611f
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions show/interfaces/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 777611f

Please sign in to comment.