@@ -566,53 +566,6 @@ def show():
566
566
567
567
click .echo (tabulate (data , headers = header , tablefmt = "simple" , missingval = "" ))
568
568
569
- def _update_config_db_flex_counter_table (status , filename ):
570
- """ Update counter configuration in config_db file """
571
- with open (filename ) as config_db_file :
572
- config_db = json .load (config_db_file )
573
-
574
- write_config_db = False
575
- if "FLEX_COUNTER_TABLE" in config_db :
576
- if status != "delay" :
577
- for counter , counter_config in config_db ["FLEX_COUNTER_TABLE" ].items ():
578
- if "FLEX_COUNTER_STATUS" in counter_config and \
579
- counter_config ["FLEX_COUNTER_STATUS" ] is not status :
580
- counter_config ["FLEX_COUNTER_STATUS" ] = status
581
- write_config_db = True
582
-
583
- elif status == "delay" :
584
- write_config_db = True
585
- for key in config_db ["FLEX_COUNTER_TABLE" ].keys ():
586
- config_db ["FLEX_COUNTER_TABLE" ][key ].update ({"FLEX_COUNTER_DELAY_STATUS" :"true" })
587
-
588
- if write_config_db :
589
- with open (filename , 'w' ) as config_db_file :
590
- json .dump (config_db , config_db_file , indent = 4 )
591
-
592
- # Working on Config DB
593
- @cli .group ()
594
- def config_db ():
595
- """ Config DB counter commands """
596
-
597
- @config_db .command ()
598
- @click .argument ("filename" , default = "/etc/sonic/config_db.json" , type = click .Path (exists = True ))
599
- def enable (filename ):
600
- """ Enable counter configuration in config_db file """
601
- _update_config_db_flex_counter_table ("enable" , filename )
602
-
603
- @config_db .command ()
604
- @click .argument ("filename" , default = "/etc/sonic/config_db.json" , type = click .Path (exists = True ))
605
- def disable (filename ):
606
- """ Disable counter configuration in config_db file """
607
- _update_config_db_flex_counter_table ("disable" , filename )
608
-
609
- @config_db .command ()
610
- @click .argument ("filename" , default = "/etc/sonic/config_db.json" , type = click .Path (exists = True ))
611
- def delay (filename ):
612
- """ Delay counters in config_db file """
613
- _update_config_db_flex_counter_table ("delay" , filename )
614
-
615
-
616
569
"""
617
570
The list of dynamic commands that are added on a specific condition.
618
571
Format:
0 commit comments