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.
pull/43533/head
mjmayer 6 years ago committed by Jordan Borean
parent 9e5e35e64c
commit 4549962f85

@ -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)

Loading…
Cancel
Save