1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

sort the port list properly (.sort() returns None)

This commit is contained in:
schp 2018-06-14 22:19:05 +02:00 committed by Toshio Kuratomi
parent 0691c9c099
commit 63f2ad8776

View file

@ -272,7 +272,7 @@ def sorted_allowed_list(allowed_list):
# sort by protocol
allowed_by_protocol = sorted(allowed_list, key=lambda x: x['IPProtocol'])
# 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():