Skip to content

Commit f57427e

Browse files
zhenggen-xujleveque
authored andcommitted
Use natual sort for 'show acl table' ports (sonic-net#157)
1 parent ab0f1b1 commit f57427e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

acl_loader/main.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import json
88
import argparse
99
import tabulate
10+
from natsort import natsorted
1011

1112
import openconfig_acl
1213
import pyangbind.lib.pybindJSON as pybindJSON
@@ -384,7 +385,7 @@ def show_table(self, table_name):
384385
if not val["ports"]:
385386
data.append([key, val["type"], "", val["policy_desc"]])
386387
else:
387-
ports = sorted(val["ports"], )
388+
ports = natsorted(val["ports"])
388389
data.append([key, val["type"], ports[0], val["policy_desc"]])
389390

390391
if len(ports) > 1:

0 commit comments

Comments
 (0)