Skip to content

Commit

Permalink
[acl-loader] Make list sorting compliant with Python 3 (#1257)
Browse files Browse the repository at this point in the history
In Python 3, sort() takes no positional arguments, only keyword arguments. Fix acl-loader to comply.

Fixes vsimage build failure in sonic-net/sonic-buildimage#5926
  • Loading branch information
jleveque authored Nov 20, 2020
1 parent 05c8e33 commit 0d1d6e1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions acl_loader/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,11 +826,7 @@ def pop_matches(val):

raw_data.append([priority, rule_data])

def cmp_rules(a, b):
return cmp(a[0], b[0])

raw_data.sort(cmp_rules)
raw_data.reverse()
raw_data.sort(key=lambda x: x[0], reverse=True)

data = []
for _, d in raw_data:
Expand Down

0 comments on commit 0d1d6e1

Please sign in to comment.