From f56197df94e7c0ae41d50587a8a6215f6a9e6d2d Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Tue, 3 Jul 2018 11:50:36 -0700 Subject: [PATCH] [stable-2.5] sort the port list properly (.sort() returns None) (#41603) (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 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():