Skip to content

Commit

Permalink
Use natual sort for 'show acl table' ports (sonic-net#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenggen-xu authored and jleveque committed Dec 1, 2017
1 parent ab0f1b1 commit f57427e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion acl_loader/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import json
import argparse
import tabulate
from natsort import natsorted

import openconfig_acl
import pyangbind.lib.pybindJSON as pybindJSON
Expand Down Expand Up @@ -384,7 +385,7 @@ def show_table(self, table_name):
if not val["ports"]:
data.append([key, val["type"], "", val["policy_desc"]])
else:
ports = sorted(val["ports"], )
ports = natsorted(val["ports"])
data.append([key, val["type"], ports[0], val["policy_desc"]])

if len(ports) > 1:
Expand Down

0 comments on commit f57427e

Please sign in to comment.