diff --git a/lib/ansible/modules/cloud/google/gce_net.py b/lib/ansible/modules/cloud/google/gce_net.py index d4c298b214..3cb39189ec 100644 --- a/lib/ansible/modules/cloud/google/gce_net.py +++ b/lib/ansible/modules/cloud/google/gce_net.py @@ -310,7 +310,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():