From 8aa7930c864d31414ab29c859f938fbd209d3f55 Mon Sep 17 00:00:00 2001 From: wenyiz2021 <91497961+wenyiz2021@users.noreply.github.com> Date: Mon, 13 Feb 2023 11:04:58 -0800 Subject: [PATCH] [portstat CLI] don't print reminder if use json format (#2670) * no print if use json format * add print for chassis --- scripts/portstat | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/portstat b/scripts/portstat index 8f4b65321d..975db159ff 100755 --- a/scripts/portstat +++ b/scripts/portstat @@ -17,6 +17,7 @@ from collections import OrderedDict, namedtuple from natsort import natsorted from tabulate import tabulate from sonic_py_common import multi_asic +from sonic_py_common import device_info # mock the redis for unit test purposes # try: @@ -324,8 +325,8 @@ class Portstat(object): print(table_as_json(table, header)) else: print(tabulate(table, header, tablefmt='simple', stralign='right')) - if multi_asic.is_multi_asic(): - print("\nReminder: Please execute 'show interface counters -d all' to include internal links\n") + if multi_asic.is_multi_asic() or device_info.is_chassis(): + print("\nReminder: Please execute 'show interface counters -d all' to include internal links\n") def cnstat_intf_diff_print(self, cnstat_new_dict, cnstat_old_dict, intf_list): """ @@ -526,8 +527,8 @@ class Portstat(object): print(table_as_json(table, header)) else: print(tabulate(table, header, tablefmt='simple', stralign='right')) - if multi_asic.is_multi_asic(): - print("\nReminder: Please execute 'show interface counters -d all' to include internal links\n") + if multi_asic.is_multi_asic() or device_info.is_chassis(): + print("\nReminder: Please execute 'show interface counters -d all' to include internal links\n") def main(): parser = argparse.ArgumentParser(description='Display the ports state and counters',