Force values to be sorted when compared. (#65315)

* Force values to be sorted when compared.

This avoids problems where lists of values could be generated in
indeterminate order.

* Update lib/ansible/module_utils/aws/elbv2.py

Thank you felixfontein, sorry I missed this detail.

Co-Authored-By: Felix Fontein <felix@fontein.de>
This commit is contained in:
roberbri 2019-12-18 21:35:35 +00:00 committed by ansibot
parent aa6dbbf7ea
commit 777b6d3e30

View file

@ -720,7 +720,7 @@ class ELBListenerRules(object):
current_condition['SourceIpConfig']['Values'][0] == condition['SourceIpConfig']['Values'][0]):
condition_found = True
break
elif current_condition['Field'] == condition['Field'] and current_condition['Values'] == condition['Values']:
elif current_condition['Field'] == condition['Field'] and sorted(current_condition['Values']) == sorted(condition['Values']):
condition_found = True
break