mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-01 00:03:10 +00:00
sort the port list properly (.sort() returns None)
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user