@@ -320,13 +320,13 @@ class Portstat(object):
320320 format_number_with_comma (data .tx_err ),
321321 format_number_with_comma (data .tx_drop ),
322322 format_number_with_comma (data .tx_ovr )))
323-
324- if use_json :
325- print (table_as_json (table , header ))
326- else :
327- print (tabulate (table , header , tablefmt = 'simple' , stralign = 'right' ))
328- if multi_asic .is_multi_asic () or device_info .is_chassis ():
329- print ("\n Reminder: Please execute 'show interface counters -d all' to include internal links\n " )
323+ if table :
324+ if use_json :
325+ print (table_as_json (table , header ))
326+ else :
327+ print (tabulate (table , header , tablefmt = 'simple' , stralign = 'right' ))
328+ if multi_asic .is_multi_asic () or device_info .is_chassis () and not use_json :
329+ print ("\n Reminder: Please execute 'show interface counters -d all' to include internal links\n " )
330330
331331 def cnstat_intf_diff_print (self , cnstat_new_dict , cnstat_old_dict , intf_list ):
332332 """
@@ -522,13 +522,13 @@ class Portstat(object):
522522 format_number_with_comma (cntr .tx_err ),
523523 format_number_with_comma (cntr .tx_drop ),
524524 format_number_with_comma (cntr .tx_ovr )))
525-
526- if use_json :
527- print (table_as_json (table , header ))
528- else :
529- print (tabulate (table , header , tablefmt = 'simple' , stralign = 'right' ))
530- if multi_asic .is_multi_asic () or device_info .is_chassis ():
531- print ("\n Reminder: Please execute 'show interface counters -d all' to include internal links\n " )
525+ if table :
526+ if use_json :
527+ print (table_as_json (table , header ))
528+ else :
529+ print (tabulate (table , header , tablefmt = 'simple' , stralign = 'right' ))
530+ if multi_asic .is_multi_asic () or device_info .is_chassis () and not use_json :
531+ print ("\n Reminder: Please execute 'show interface counters -d all' to include internal links\n " )
532532
533533def main ():
534534 parser = argparse .ArgumentParser (description = 'Display the ports state and counters' ,
0 commit comments