From 5812025b3123f95c4a71a31869dab5d4a49575d3 Mon Sep 17 00:00:00 2001 From: wenyiz2021 <91497961+wenyiz2021@users.noreply.github.com> Date: Tue, 13 Jun 2023 15:36:47 -0700 Subject: [PATCH] fix precedence in portstat CLI (#2874) fix sonic-net/sonic-buildimage#15439 --- scripts/portstat | 4 ++-- tests/portstat_test.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/portstat b/scripts/portstat index 43746cc1c3e..6294ba57a93 100755 --- a/scripts/portstat +++ b/scripts/portstat @@ -338,7 +338,7 @@ class Portstat(object): print(table_as_json(table, header)) else: print(tabulate(table, header, tablefmt='simple', stralign='right')) - if multi_asic.is_multi_asic() or device_info.is_chassis() and not use_json: + if (multi_asic.is_multi_asic() or device_info.is_chassis()) and not use_json: 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): @@ -556,7 +556,7 @@ class Portstat(object): print(table_as_json(table, header)) else: print(tabulate(table, header, tablefmt='simple', stralign='right')) - if multi_asic.is_multi_asic() or device_info.is_chassis() and not use_json: + if (multi_asic.is_multi_asic() or device_info.is_chassis()) and not use_json: print("\nReminder: Please execute 'show interface counters -d all' to include internal links\n") def main(): diff --git a/tests/portstat_test.py b/tests/portstat_test.py index bf7a2db190b..885c06662f4 100644 --- a/tests/portstat_test.py +++ b/tests/portstat_test.py @@ -192,7 +192,6 @@ Reminder: Please execute 'show interface counters -d all' to include internal links """ - intf_invalid_asic_error = """ValueError: Unknown Namespace asic99""" intf_counters_detailed = """\