File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import swsssdk
29
29
import sys
30
30
31
31
from tabulate import tabulate
32
+ from natsort import natsorted
32
33
33
34
### temp file to save counter positions when doing clear counter action.
34
35
### if we could have a SAI command to clear counters will be better, so no need to maintain
@@ -253,10 +254,13 @@ class AclStat(object):
253
254
table_props .append (line )
254
255
print (tabulate (table_props , headers = ['Property' , 'Value' ]), "\n " )
255
256
256
- for table_name , rule_name in self .acl_rules .keys ():
257
+ acl_rules_sort = self .acl_rules .keys ()
258
+ acl_rules_sort = natsorted (acl_rules_sort , key = lambda x : (x [0 ], x [1 ]))
259
+
260
+ for table_name , rule_name in acl_rules_sort :
257
261
rule_props = []
258
262
rule = self .acl_rules [table_name , rule_name ]
259
- header = "ACL Rule: " + rule_name
263
+ header = "ACL Table: " + table_name + ", ACL Rule: " + rule_name
260
264
print (header )
261
265
print ("=" * len (header ))
262
266
for rk in rule .keys ():
You can’t perform that action at this time.
0 commit comments