[stable-2.6] sort the port list properly (.sort() returns None)

(cherry picked from commit 63f2ad8776)

Co-authored-by: schp <schonhofen@gmail.com>
pull/41610/head
schp 7 years ago committed by Matt Clay
parent dcfea7d822
commit aa6954e4ee

@ -272,7 +272,7 @@ def sorted_allowed_list(allowed_list):
# sort by protocol # sort by protocol
allowed_by_protocol = sorted(allowed_list, key=lambda x: x['IPProtocol']) allowed_by_protocol = sorted(allowed_list, key=lambda x: x['IPProtocol'])
# sort the ports list # sort the ports list
return sorted(allowed_by_protocol, key=lambda y: y.get('ports', []).sort()) return sorted(allowed_by_protocol, key=lambda y: sorted(y.get('ports', [])))
def main(): def main():

Loading…
Cancel
Save