From 4549962f8535c6892637c74c8c7dd3f8953a1678 Mon Sep 17 00:00:00 2001 From: mjmayer Date: Thu, 2 Aug 2018 00:05:20 -0700 Subject: [PATCH] Fix comparison of priority (#43329) The existing rule priority comes from aws as a string. It is then compared to the new rule priority, which is defined as an int. This change casts the new rule priority as a string making the comparison work. The reason to cast it as a string rather than an int is used because a priority can also be set to 'default'. When trying to case 'default' as an int, it creates an error. --- lib/ansible/module_utils/aws/elbv2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/aws/elbv2.py b/lib/ansible/module_utils/aws/elbv2.py index 7928f66fa41..2261001877c 100644 --- a/lib/ansible/module_utils/aws/elbv2.py +++ b/lib/ansible/module_utils/aws/elbv2.py @@ -688,7 +688,7 @@ class ELBListenerRules(object): for current_rule in self.current_rules: current_rule_passed_to_module = False for new_rule in self.rules[:]: - if current_rule['Priority'] == new_rule['Priority']: + if current_rule['Priority'] == str(new_rule['Priority']): current_rule_passed_to_module = True # Remove what we match so that what is left can be marked as 'to be added' rules_to_add.remove(new_rule)