From aa6954e4ee1faf78bdd43c5ea8df4bdd43eaec17 Mon Sep 17 00:00:00 2001 From: schp Date: Thu, 14 Jun 2018 22:19:05 +0200 Subject: [PATCH] [stable-2.6] sort the port list properly (.sort() returns None) (cherry picked from commit 63f2ad8776314930a800076ef363f4e60a2ef1a4) Co-authored-by: schp --- lib/ansible/modules/cloud/google/gce_net.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/google/gce_net.py b/lib/ansible/modules/cloud/google/gce_net.py index 64a9721b9ef..27e5df5b09f 100644 --- a/lib/ansible/modules/cloud/google/gce_net.py +++ b/lib/ansible/modules/cloud/google/gce_net.py @@ -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():